Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 ( [id://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?"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found