$ cat torres09.pl #!/usr/bin/perl -w use strict; while(my $line=){ chomp $line; if ( $line =~ m/^\d+$/){ printf "%s\n",$line; } } exit(0); __END__ 0123 0444 A123 $ perl torres09.pl 0123 0444