Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2020-06-05 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?