in reply to Re: checking input using grep()
in thread checking input using grep()

die unless grep $_ eq $input, @var;BLOCKs are ugly :) but I second the eq notion.

Parham, look at quotemeta also.

Replies are listed 'Best First'.
Re: Re: Re: checking input using grep()
by chip (Curate) on Dec 29, 2001 at 00:14 UTC
    I usually avoid BLOCK constructs when I can, but even more than BLOCKs I dislike having similar-looking code that acts very different. So I like the BLOCK versions of grep and map.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      I do see your point.

      Mine is I like to regard brackets as syntactic sugar that I only use where really necessary for perl or to highlight any hidden precedence issue. I'm so used to automatically resolving long statements right-to-left without second though that when brackets automatically are "pay attention with precedence here!" signs for me. So I find it very distracting if there's many of them, and it takes me a lot longer to break up the statement into its parts.

      Once again it's a matter of taste and habit I guess - TMTOWTDI :-)