in reply to Re: Scalar Value Not Available To Subroutine
in thread Scalar Value Not Available To Subroutine
So loop "localisation" is different to the "localisation" done by local?
#!/usr/bin/perl use strict; our $uid; my @array = ("one","two","three"); for (my $i = 0; $i < @array; $i++) { local $uid = $array[$i]; print "uid in loop=$uid\n"; # prints each value of $uid as expected mail($uid); } sub mail { # never prints the value of $uid ? ? print "uid in sub=$uid\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Scalar Value Not Available To Subroutine
by BrowserUk (Patriarch) on Dec 20, 2012 at 18:04 UTC | |
by ikegami (Patriarch) on Dec 21, 2012 at 05:41 UTC | |
|
Re^3: Scalar Value Not Available To Subroutine
by ikegami (Patriarch) on Dec 21, 2012 at 05:38 UTC | |
|
Re^3: Scalar Value Not Available To Subroutine
by LanX (Saint) on Dec 20, 2012 at 19:06 UTC |