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

Thanks for the example one-liner. I'm familiar with qq, but for some reason I wasn't associating the tilde with qq and was overthinking it - thought it was some black magic shorthand, but no.

Replies are listed 'Best First'.
Re^3: What does $_ = qq~"$_"~ do?
by haukex (Archbishop) on May 28, 2019 at 07:55 UTC

    Fun fact: the delimiters can even be word characters, provided there's whitespace after the qq:

    $ perl -wMstrict -le 'print qq queueq' ueue $ perl -wMstrict -le 'print qq 01230' 123

      Fun fact: Your coworkers will curse your name unto the end of time if you . . . erm, "code" like this in anything production (especially if you do it without leaving 30 foot high neon warning signs in a comment :). (If you do it in code for personal use you might want to talk with a professional about the deep seated self loathing you're manifesting.)

      Obvious reference to relevant Jurassic Park quote . . .

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        More fun facts! I once wrote a script to search a word list for words that make valid regexen which convert one valid word into another.

        $ perl -le 'print bangs =~s engender' bands $ perl -le 'print halved =~s avatar' halted $ perl -le 'print stove =~s evener' stone