Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 pondering the Monastery: (4)
As of 2015-07-28 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls