Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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?)

--bwana147

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://108731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2016-08-31 22:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (436 votes). Check out past polls.