in reply to Scalar and void subroutines
Philsub name { ... if (not defined wantarray) { # do your void context behavior } elsif (wantarray) { # do your scalar context behavior } else { # do your list context behavior } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scalar and void subroutines
by ysth (Canon) on Nov 11, 2005 at 06:53 UTC |