Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: I don't understand a piece of this code

by cheekuperl (Monk)
on Jun 18, 2012 at 03:25 UTC ( #976729=note: print w/ replies, xml ) Need Help??


in reply to I don't understand a piece of this code

The code is doing what you've understood:

$what = "[box]"; foreach (qw(in[box] out[box] white[sox])) { #Assign to $_, one by one, + each value in parenthesis if (/\Q$what\E/) { print "$_ matched!\n";
\Q and \E disable special meaning of all metachars in between them. See perlre


Comment on Re: I don't understand a piece of this code
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-09-18 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (108 votes), past polls