Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Command Grep

by bwana147 (Pilgrim)
on Aug 29, 2001 at 15:01 UTC ( #108731=note: print w/replies, xml ) Need Help??

in reply to Command Grep

Nice! Two comments though:

  • Since $pat doesn't ever change, you can use the /o modifier to prevent the recompilation of the regex at each loop: $name =~ /$pat/o
  • Since you use pipes as pattern delimiter, the slash looses its special meaning and no longer needs be escaped: s|//|/|g;. That's easier to read, IMHO (btw, what's the use of this?)


Replies are listed 'Best First'.
Re: Re: Command Grep
by fundflow (Chaplain) on Aug 29, 2001 at 19:58 UTC
    Updated, thanks.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://108731]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-07-29 12:29 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (436 votes). Check out past polls.