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

Re: I don't understand a piece of this code (What is qw()? How does qw() work?)

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

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

Remember I am geting an unhelpful error message. Not sure how to debug it. ?

Remember Tutorials: Basic debugging checklist , brian's Guide to Solving Any Perl Problem?

Second verse, same as the first, go fishing :)

To see if your code is what you thought it was, use B::Deparse

$ perl -MO=Deparse,-p crates ($what = '[box]'); foreach $_ (('in[box]', 'out[box]', 'white[sox]')) { if (/\Q$what\E/) { print("$_ matched!\n"); } } crates syntax OK

Hopefully that code you should recognize ( perlintro if you don't)

For a word explanation see perlop#Quote and Quote like Operators, qw/STRING/, Quote and Quote-like Operators, Modern Perl pdf page 35 :)

I don't know how to stop this site from interpolating (correct word?) the brackets.

use code ( <c>[box]</c> ) tags or html enities, see PerlMonks FAQ, Markup in the Monastery

See also How do I compose an effective node title?, an effective title might "What is qw()?" or "How does qw() work?"

Comment on Re: I don't understand a piece of this code (What is qw()? How does qw() work?)
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2016-05-03 20:53 GMT
Find Nodes?
    Voting Booth?