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

perl's grep function with '^' and '$'

by jesuashok (Curate)
on May 25, 2007 at 09:07 UTC ( #617437=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Program : 1
    #!/usr/bin/perl
    ...
    if ( grep( /^$match/,@array ) ) {
       print "Matched\n";
    }
    
  2. or download this
    Output :
    Matched
    
  3. or download this
    # Program : 2
    #!/usr/bin/perl
    ...
    <code>
    Output :
    Matched
    
  4. or download this
    # Program : 3
    #!/usr/bin/perl
    ...
    if ( grep( /^$match$/,@array ) ) {
       print "Matched\n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-12-05 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?