in reply to Re: Chop chop
in thread Chop chop

Sure all it basically does is chop off the last char in $_ and print it. The s//foo/ construct to set $_='foo' has been a bit of a recent feature of obfus so why buck the trend ;-) The interesting thing for me is how it parses?

In the first half we have an example of precedence. Perl evals the inner-most bracket pair first, this is vital as otherwise we can not dereference the anon sub reference $$ as it does not yet exist!

Why we can get away with the x -> x -> x -> structure and what values pass to the sub are questions worth considering and not answered by you decon.

In the second half we do not need the parenths as we create our reference in $; before we start the dereferences.

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: Re: Chop chop
by iamcal (Friar) on Jun 19, 2001 at 10:23 UTC
    Sorry about not really explaining how the ->()->() bit works. I'd used this technique previsouly (though the code is generated then eval'd) in more evaluation.