Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-12-21 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (108 votes), past polls