use strict; for (0..10) { printf "%04d\n",$_; } _ _ END _ _ 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010