Hi,
I know.. this is basic question to ask over here... but still.
I need to replace the spaces given in a filename with underscore. May it be any number of spaces in between two words, it should be replaced by only and only one underscore.
e.g - the name given as - "testing for replace ment" should be taken as "testing_for_replace_ment".
At present i am using the following but it replaces each space with an underscore:
$fileName=~s/[\s|-|+]/_/g;