Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to add more intelligence to grep functionality

by GrandFather (Saint)
on Jan 11, 2006 at 19:42 UTC ( [id://522550]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    foreach (@array) {
            print "Matched :$_:\n" if /$value/;
    }
    
  2. or download this
    Matched :revenuebytrafficker:
    
  3. or download this
    use strict;
    use warnings;
    ...
    
    my @matches = grep {/$value/} @array;
    print ("Matched :" . (join ": :", @matches) . ":\n") if @matches;
    
  4. or download this
    Matched :revenuebytrafficker: :revengebysmoker:
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found