Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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?"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976730]
and a kettle whistles...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-02-18 06:01 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (250 votes). Check out past polls.