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