On Fri, 8 Nov 2002, David Cantrell wrote:

> If I have nest maps, like so ...
> 
> map { map { foo } bar }
> 
> is there any (elegant) way of getting at the outer map's idea of what $_
> is from within the inner map?  I'd rather not use a temporary variable
> if at all possible.

No.

I'm tempted to end this post here as an AOL one liner but I should justify 
myself. Anything below here might be wrong.

$_ is a global. Therefore you can't make a temporary name for it which is 
in scope when $_ is reassigned. I think things like map{} assign $_ in 
dynamic scope nyway, don't they?

S.

-- 
Shevek
I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*://;print"$x\n";eval
qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }


Reply via email to