in reply to scope of my $x in if statements
I want the $x in g($x) to reference the lexical $x on the same line.
That's currently not possible in order to allow
my $x = $x; # Initialize with value from outer scope.
The clearest alternative is probably
ormy $x = f(); if ($x and g($x)) { ... }
if (my $x = f()) { if (g($x)) { ... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: scope of my $x in if statements
by ig (Vicar) on May 08, 2009 at 01:32 UTC | |
by ikegami (Patriarch) on May 08, 2009 at 01:54 UTC | |
by ig (Vicar) on May 08, 2009 at 02:05 UTC | |
by ikegami (Patriarch) on May 08, 2009 at 03:32 UTC | |
by ig (Vicar) on May 08, 2009 at 07:17 UTC |