Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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

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 questions are moot...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-03-30 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (353 votes). Check out past polls.