ravi45722 has asked for the wisdom of the Perl Monks concerning the following question:
I am learning the Perl code. I also want to use the beauty of the perl.
I can write like this
$var or $var = 30;But in this case how can I write the code using or
Or is there any smart way to write this
if (undef $var) { $x = 40; } else { $x = 50; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need clean code
by 1nickt (Canon) on Mar 25, 2017 at 17:52 UTC | |
|
Re: Need clean code
by tybalt89 (Monsignor) on Mar 25, 2017 at 17:42 UTC | |
|
Re: Need clean code
by davido (Cardinal) on Mar 25, 2017 at 19:54 UTC | |
by eyepopslikeamosquito (Archbishop) on Mar 25, 2017 at 23:17 UTC |