Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Curious to know the internals of the following code

by jbrugger (Parson)
on Nov 08, 2005 at 07:32 UTC ( #506639=note: print w/replies, xml ) Need Help??

in reply to Curious to know the internals of the following code

A little bit of reading would have helped...
It's all there: perlop
# q/STRING/ # 'STRING' A single-quoted, literal string. A backslash represents a backslash un +less followed by the delimiter or another backslash, in which case th +e delimiter or backslash is interpolated. $foo = q!I said, "You said, 'She said it.'"!; $bar = q('This is it.'); $baz = '\n'; # a two-character string qw/STRING/ Evaluates to a list of the words extracted out of STRING, using embedd +ed whitespace as the word delimiters. It can be understood as being r +oughly equivalent to: split(' ', q/STRING/); the differences being that it generates a real list at compile time, a +nd in scalar context it returns the last element in the list. So this + expression: qw(foo bar baz) is semantically equivalent to the list: 'foo', 'bar', 'baz'
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-05-18 23:05 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (71 votes). Check out past polls.