Prty::Concat - Konkateniere Zeichenketten
Prty::Object
$str = $class->catIf($bool,sub {$expr,...});
Bedingung
Ausdrücke, deren Resultat konkateniert wird.
String
Ist Bedingung $bool falsch, liefere einen Leerstring. Andernfalls konkateniere die Werte der Ausdrücke $expr, ... und liefere das Resultat zurück. Evaluiert ein Ausdruck $expr zu undef, wird der Wert durch einen Leerstring ersetzt.
undef
Die Methode ist logisch äquivalent zu
$str = !$bool? '': join '',$expr // '', ...;
Konkatenation bei zutreffender Bedingung
Prty::Concat->catIf(1,sub { 'Dies', 'ist', 'ein', undef, 'Test', }); # 'DiesisteinTest'
1.125
Frank Seitz, http://fseitz.de/
Copyright (C) 2018 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Prty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prty
CPAN shell
perl -MCPAN -e shell install Prty
For more information on module installation, please visit the detailed CPAN module installation guide.