in reply to Return variable hangs script
Something else that might possibly helpuse strict; use warnings; my ($x, $y, $z) = returner(); sub returner { my ($a, $b, $c); # define $a $b and $c # now for something I would throw in just for kicks # just before you return.. defined $a or die("a not defined"); defined $b or die("b not defined"); defined $c or die("c not defined"); return ( $a, $b, $c); }
use strict; use warnings; my ($x, $y, $z) = @{returner()}; sub returner { my ($a, $b, $c) =( undef, undef, undef); # define $a $b and $c # now we return one value only return [$a, $b, $c]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Return variable hangs script
by joedoc (Initiate) on Jul 03, 2007 at 14:06 UTC |