|
|
| Just another Perl shrine | |
| PerlMonks |
Re^3: Conditional initialization of my-variablesby LanX (Saint) |
| on Apr 07, 2023 at 19:40 UTC ( [id://11151512]=note: print w/replies, xml ) | Need Help?? |
|
> or to add a default value > $input = 1 unless $input; Careful! Many things are false in Perl, like 0 or "" You probably meant $input = 1 unless defined $input; Anyway, both are IMHO better written as
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||