while(defined(my $line = )){ print $1,"\n" if( $line =~ m/\W?(\d)\W?/ ); }