http://qs321.pair.com?node_id=1212600


in reply to Replacing Whitespace with Underscore

See perlrun for the meaning of -switches and Quote Like Operators for the transliteration operator.

$ perl -wpe 'tr/ []/_ /' < input.txt > output.txt