yeah, nasty code. i should probably give an englishEnglish version as contrast.
use English;
sub ONE() {1}
sub ZERO() {0}
for my $each (@strings)
{
print(
( ( $INPUT_LINE_NUMBER or ONE ) ..
( $INPUT_LINE_NUMBER and ZERO ) ) - ONE,
' ',
$each,
$INPUT_RECORD_SEPARATOR,
);
}
~Particle *accelerates*
| [reply] [Watch: Dir/Any] [d/l] [select] |
Arrrgh! I give up. Where's the friggin line counter? I
understand all the pieces (that I see), but cannot figure
out where the counter is being stored. There must be some
dark implicitness going on underneath all this explicitness.
Or am I just a dullard?
YuckFoo
| [reply] [Watch: Dir/Any] |
( ( $INPUT_LINE_NUMBER or ONE ) ..
( $INPUT_LINE_NUMBER and ZERO ) )
is the range operator returning in list context. it's operating on some number >=1, to 0. it returns the empty array -- with length of the left number. subtract one to make it zero-based indexing (and to put it in scalar context,) and you've got your counter. {evil grin}
try:
perl -le "print( ($.||1..undef)-1 )for 1..4"
for a (somewhat) less obscure but equivalent obfuscation.
i hope that helps a little. mmm... dark magic.
~Particle *accelerates*
| [reply] [Watch: Dir/Any] [d/l] [select] |