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