Since you understand the shift and logical or ||, then maybe a simple example will illustrate the usage:
use warnings; use strict; my $age = 15; print get_age($age); # my age is: 15 print "\n"; print get_age(); # my age is: 200 sub get_age { my $my_age = shift || 200; return " my age is: ", $my_age; }
In reply to Re: shift and logical or
by 2teez
in thread shift and logical or
by jonagondos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |