in reply to Re: spaceship japh
in thread spaceship japh

assigns the anon sub to a typeglob

that's true.

*{'\''}

nearly. The name of the typeglob is \'\n, that is: Backslash-SingleQuote-Newline (that means you can have sub-names in perl that contain a Newline!)

So, what happens is:

*{'\' '}=sub{die 'just another perl hacker '};

Assign the anon sub to the typeglob \'\n.

bless&{'\' '}

bless something. But what? The return value of the soubroutine \'\n.

So the sub gets called. But it dies with the error-message 'just another Perl hacker'. Because the message ends in a newline, the ", at scriptname line blabla"-part is skipped.

As the script dies here, bless is actually never executed.

Resumee:

-- #!/usr/bin/perl for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}