in reply to Re: Re: Re: Guess, what following simple oneliner print:
in thread Guess, what following simple oneliner print:
But print allways uses list context. So print doesn't get the string 'This::is::it', but a list consisting of 'This::is::it', '', '', which still evaluates to 'This::is::it'
Try this:
perl -we "print test'bla=>$/"
You'll see that the value of $/ will be printed, as => is just another comma operator, so the above is the same as
perl -we "print test'bla,$/"
You can pack in even more commas:
perl -we "print test'bla=>=>=>=>=>''"
(BTW, I've been using the single-quote-as-package-delimiter trick for quite some time in my .sig>
-- #!/usr/bin/perl for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
|
|---|