in reply to things are not what they seem ( can you explain it to me )
Changing the delimiters for the quotelike ops to more familiar characters:use strict; $\ = $, = $; = ~ join ~ q º º, ~ ~ ~ reverse join q ¿ ¿, qw ~ rekcaH lreP rehtonA tsuJ ~; @; = join /\n/ , split map { ucfirst } split; ~ ~ ~ ~ print qq º Just Anothe\r Pe\rl Hacke\r º;
Precalculating the results from line 3:use strict; $\ = $, = $; = ~ join ~ "\n", ~ ~ ~ reverse join ' ', qw(rekcaH lreP r +ehtonA tsuJ); @; = join /\n/ , split map { ucfirst } split; ~ ~ ~ ~ print "Just Anothe\r Pe\rl Hacke\r";
Putting it back in and removing the other no-op XORs:$\ = $, = $; = ~ join ~ "\n", ~ ~ ~ reverse join ' ', qw(rekcaH lreP r +ehtonA tsuJ); $\ = $, = $; = ~ join ~ "\n", ~ ~ ~ reverse "rekcaH lreP rehtonA tsuJ" +; $\ = $, = $; = ~ join ~ "\n", ~ ~ ~ "Just Another Perl Hacker"; # join on a single value is a no-op $\ = $, = $; = ~ ~ ~ ~ "Just Another Perl Hacker"; # an even number of XOR is a no-op $\ = $, = $; = "Just Another Perl Hacker";
It's getting pretty obvious. @; is neither a special variable nor used anywhere so out with it. There's no interpolation so $, and $; can go too.use strict; $\ = $, = $; = "Just Another Perl Hacker"; @; = join /\n/ , split map { ucfirst } split; print "Just Anothe\r Pe\rl Hacke\r";
The \r at the end of the print string parameter makes the cursor go back to the beginning of the line, effectively letting the output record separator overwrite the already printed bits. There could be an empty string for the same effect.use strict; $\ = "Just Another Perl Hacker"; print "Just Anothe\r Pe\rl Hacke\r";
use strict; $\ = "Just Another Perl Hacker"; print "";
Makeshifts last the longest.
|
|---|