#x2.pl for ( 0.. 10 ) { open $out, ">$ARGV[0]"; print $out "$_\n"; close $out; sleep(1); }