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 ( [id://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?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-18 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found