open my $hfile, $ARGV[0] or die "Can't open $ARGV[0] for reading: $!"; while( my $line = <$hfile> ) { $line =~ s/\s+/\n/g; print $line; } close $hfile;