in reply to Re: foreach inside print
in thread foreach inside print

One of the limitations of map() is that it only will use $_; you don't have a way of saying the equivalent of foreach my $file (@files) {...}.
Oh, sure there is:
map {local *file = *_; ...} @files;

Abigail

Replies are listed 'Best First'.
Re: Re: foreach inside print
by ysth (Canon) on May 18, 2004 at 15:55 UTC
    local ne my. Might as well stick to $_ IMO
      Yeah, and map ne foreach. The question wasn't about something that was exactly the same - just an equivalent.

      Abigail