Philsub name { ... if (not defined wantarray) { # do your void context behavior } elsif (wantarray) { # do your scalar context behavior } else { # do your list context behavior } }
In reply to Re: Scalar and void subroutines
by philcrow
in thread Scalar and void subroutines
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |