Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Search Algorithm

by BigJoe (Curate)
on Aug 10, 2000 at 17:44 UTC ( #27286=note: print w/replies, xml ) Need Help??


in reply to Search Algorithm

I would use the great grep command instead of your 3rd loop.
This is out of the Perl Cookbook p 114
@matching = grep { /^gnat/ } `who`
This matches anything that comes out of the who command with the regular expression ^gnat

--BigJoe

Learn patience, you must.
Young PerlMonk, craves Not these things.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-12-14 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (394 votes). Check out past polls.

    Notices?