replace space with underscores

hi

i am reading a file line by line
how can i convert spaces to undersores

so
90c2826d-0e9d-11e3-82d5-a94f4ab1c221-'Miso Ghetto (Video 2008)
will become

90c2826d-0e9d-11e3-82d5-a94f4ab1c221-'Miso_Ghetto_(Video_2008)
VlearnsAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
$_=q{90c2826d-0e9d-11e3-82d5-a94f4ab1c221-'Miso Ghetto (Video 2008)};
s/\s/_/g;
print;
0
 
Suhas .Connect With a Mentor QA ManagerCommented:
$myvar1 = "90c2826d-0e9d-11e3-82d5-a94f4ab1c221-'Miso Ghetto (Video 2008)";
$myvar1 =~ tr/ /_/;
print($myvar1);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.