sub han { if (my $l = pop) { han(@_[0,2,1],$l-1); print "Move disc $l from $_[0] to $_[2]\n"; han(@_[1,0,2],$l-1); } }