Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: What does $_ = qq~"$_"~ do?

by Paladin (Vicar)
on May 27, 2019 at 18:27 UTC ( [id://11100594]=note: print w/replies, xml ) Need Help??


in reply to What does $_ = qq~"$_"~ do?

qq is the generic double quoting operator. It's "" with using different delimiters. So the line $_ = qq~"$_"~; encloses whatever text is in $_ with double quotes. It's the same as $_ = "\"$_\""; without having to escape the " characters.

Replies are listed 'Best First'.
Re^2: What does $_ = qq~"$_"~ do?
by mkj (Initiate) on May 28, 2019 at 03:40 UTC
    I was completely overthinking it - thanks for clarifying.

      I was completely overthinking it - thanks for clarifying.

      Hi,

      There is a list for overthinking avoidance :)

      Basic debugging checklist

      perl -MO=Deparse - $_ = qq~"$_"~; __END__ $_ = qq["$_"];

      ppi_dumper is also great at hints

      $ ppi_dumper input_file PPI::Document PPI::Statement PPI::Token::Magic '$_' PPI::Token::Whitespace ' ' PPI::Token::Operator '=' PPI::Token::Whitespace ' ' PPI::Token::Quote::Interpolate 'qq~"$_"~' PPI::Token::Structure ';'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found