in reply to Re: Remembering values from multiple condition 'if'
in thread Remembering values from multiple condition 'if'

Argh, I'm out of votes. Consider yourself ++ed. Just a question though, why don't you just do like so? my @files = grep -e, qw(foo foobar bar); ____________
Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: Remembering values from multiple condition 'if'
by TheHobbit (Pilgrim) on Jul 02, 2002 at 19:53 UTC

    Hi,
    Well, with that grep, @files will end up containing only ones, and you'll not even be able to sort out exactly 'which' files where there...

    Cheers


    Leo TheHobbit
      Actually, no - that would happen if I were using map. grep doesn't return the value of the expression, it returns the original element if the expression evaluates to true. Observe:
      $ touch a b e ; perl -le'@f=grep -e, qw(a b c d e f); print "@f"' a b e
      ____________
      Makeshifts last the longest.