Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: testing an if statement in a string

by brcjacks (Initiate)
on Oct 31, 2013 at 15:03 UTC ( #1060590=note: print w/replies, xml ) Need Help??


in reply to Re: testing an if statement in a string
in thread testing an if statement in a string

Interesting. Why the double parenthesis in line 2?
  • Comment on Re^2: testing an if statement in a string

Replies are listed 'Best First'.
Re^3: testing an if statement in a string
by AnomalousMonk (Bishop) on Oct 31, 2013 at 23:14 UTC
    Why the double parenthesis in line 2?

    The outermost pair of parens are simply the paired delimiters of the  q// operator; a wide range of delimiters, paired or not, can be used by the various string and regex operators. The inner parens are copied from the string as it was given in the OP.

    >perl -wMstrict -le "my $s = q(foo); print qq{'$s'}; ;; $s = q((bar)); print qq/'$s'/; " 'foo' '(bar)'

    See Quote and Quote-like Operators (and also Regexp Quote-Like Operators) in perlop.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2020-07-08 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?