in reply to Twin-lines japh

($_=Just,$\="l hacker")=~(S_&&y,Jk csluath, hate Porn,),print, ($_=Just,$\="l hacker")=~($_&&y,Jk csluath, hate Porn,),print,

++, very Abigail-ish IMHO: it neither really features data nor logic obfu, in the sense that it's easy to see where the data is and have at least a naive understanding of what the logic does, but it's surprising that is works at all that!

The japh is a single statement, composed of four comma separated expressions. The first one is

($_=Just,$\="l hacker")=~(S_&&y,Jk csluath, hate Porn,)

On the lhs $_ and $\ are assigned 'Just' and 'l hacker' respectively and $\ is returned by the comma operator in scalar context and then is bound to the expression on the rhs. The latter is equivalent to (but more funny than - thanks to a savvy choice of the order of charachters)

'S_' && tr/ Jachkls-u/a otnh erP/)

and since S_ is a true constant, the transliteration is carried on, which makes 'l hacker' into ' another', just as if 'S_' && were not there at all.

Actually, this was the most surprising part for me, that is that you can use a complex expression on the rhs of =~: in fact I most often rely on aliasing to $_ and implicit operation of matches, substitutions and transliterations on it, but retrospectively it's very perlish and obvious that an expression would be allowed to. To quote from perldoc perlop:

Binary "=~" binds a scalar expression to a pattern match. Certain operations search or modify the string $_ by default. This operator makes that kind of operation work on some other string. The right argument is a search pattern, substitution, or transliteration. The le +ft argument is what is supposed to be searched, substituted, or transliterated instead of the default $_. When used in scalar context, the return value generally indicates the success of the operation. Behavior in list context depends on the particular operator. See "Rege +xp Quote-Like Operators" for details and perlretut for examples using the +se operators. If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search patter +n at run time.

Here, the crucial point is that S_ is a (bareword) constant, hence the emphasis above. (Is this to be considered a side effect of a compile time optimization?) In fact, passing to the second line, it's just the same as the first one except for having $_ instead of S_. In which case the full expression

$_ && tr/ Jachkls-u/a otnh erP/)

is evaluated and its return value applied as pattern march, which does nothing. But as a side effect the same transliteration as above is applied, this time implicitly to $_ which makes 'Just' into ' Per' and leaves 'l hacker' untouched.

Thus, all in all, the two prints print respectively 'Just another', ' Perl hacker'.