Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by clinton (Priest)
on May 25, 2007 at 09:13 UTC ( #617440=note: print w/replies, xml ) Need Help??


in reply to perl's grep function with '^' and '$'

Indeed you are, you should be using qw not qq. See perlop

# Program : 3 #!/usr/bin/perl use strict; my $match = 'A'; my @array = qw[Anthony Mark Alex A]; 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: note [id://617440]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-12-02 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (22 votes). Check out past polls.

    Notices?