Guess, what following simple oneliner print:
perl -we "print This'is'it=>,''"
Actually it was amazing for me to see that output is
This::is::it
After I saw that output, I am able to mumble trying to explain output, but no chance to predict it before running that oneliner!

Courage, the Cowardly Dog.

Replies are listed 'Best First'.
Re: Guess, what following simple oneliner print:
by BUU (Prior) on Jul 22, 2002 at 07:51 UTC
    baz'foo is a depreceated way of refferring to name spaces/hiearchys, they probably get translated into ::'s by the compiler someplace, then the => stringifies it.
      ... but why didn't stringification came first?
        BUU and moxliukas are spot on with regards to the ' being the old package delimiter - However with regards to the => operator and the quotes, the use of this operator is synonymous with the comma operator which in the scalar context, evaluates the left argument. This means that the This'is'it code is evaluated prior to being printed within the interpolated quotation marks.

        For a further explanation on this, see perlop under the heading "Comma Operator".

         

      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Guess, what following simple oneliner print:
by moxliukas (Curate) on Jul 22, 2002 at 08:02 UTC

    I was actually surprised, because this code was the first code in Obfuscation that I *did* understand just by looking at it (hmmm... My Perl knowledge must be progressing ;)

    This is taken from perlmod manpage:

    The old package delimiter was a single quote, but double
     colon is now the preferred delimiter, in part because it's 
    more readable to humans, and in part because it's more 
    readable to emacs macros. It also makes C++ programmers feel
     like they know what's going on--as opposed to using the 
    single quote as separator, which was there to make Ada 
    programmers feel like they knew what's going on. Because the 
    old-fashioned syntax is still supported for backwards 
    compatibility, if you try to use a string like "This is 
    $owner's house", you'll be accessing $owner::s; that is, the 
    $s variable in package owner, which is probably not what you 
    meant. Use braces to disambiguate, as in "This is ${owner}'s 
    house".
    
      I was surprised by your surprise :)

      Following my node from obfuscation section: Self-explanatory program of free will is even easier to de-obfuscate and understand, but given rather for fun (and I consider it as my best attempt at all).

      And yes, I knew about elder usage of apostrophes. The fact that stringification came at unexpected moment surprised me at the very first moment when I saw that output!

      Best wishes,
      Courage, the Cowardly Dog.