in reply to What does your old Perl code look like?

The oldest Perl code written by me I could find was located in my university account (yes, I still have access there, as I occasionally help them with projects I was once involved in). It's called array2.pl (I wonder what happened to version 1), it's modification time is the 12th November 2001 and it looks like this:
#!/usr/bin/perl -w # use integer; sub swap { $_[0]=$_[0] ^ $_[1]; $_[1]=$_[0] ^ $_[1]; $_[0]=$_[0] ^ $_[1]; } sub nsd { my ($a,$b)=@_; do { if ($a<$b) {$b-=$a} elsif ($b<$a) {$a-=$b} } until ($a==$b); return($a) } # main print ("Array size: "); chomp($n=<stdin>); print ("Shift: "); chomp($d=<stdin>); print("NSD:",nsd($n,$d),"\n"); for ($i=0;$i++<$n;$array[$i]=$i){} # for ($j=0;$j<nsd($n,$d);$j++) { $i=$n-$j; $aux=$array[$i]; unless ($next=($i+$d)%$n) {$next=$n} do { for($k=0;$k++<$n;printf("%2.0d",$array[$k]),print(",")){} print("\n"); $array[$i]=$array[$next]; $array[$next]=$aux; $i=$next; $aux=$array[$i]; unless ($next=($i+$d)%$n) {$next=$n} } until ($next==$n-$j); } for($k=0;$k++<$n;print($array[$k],",")){}

I was probably experimenting with the programming language that was new to me. For some reason, I disliked whitespace. Is this some kind of self-embarassment contest? ;-)

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]