$a=1; $b=2; sub x { my (0?$a:$b) = shift; print"a=$a\nb=$b\n"; $a=shift } x(3,30); x(4,40); x(5,50); __END__ #Output a= b=3 a=30 b=4 a=40 b=5