Perl Writing Variables to File

Associate
Joined
28 May 2008
Posts
346
In my perl program I have to write certain details to a file, I am using the code..

Code:
open (MYFILE, '>>myfile.txt');
    print MYFILE "Name: $sname $fname\n\n";

    close(MYFILE);

The entered name "Joe Bloggs" will be written as "Bloggs Joe"

Does any one know how I can edit my code so it writes the name like...

"BLOGGS_JOE"

Thanks :D
 
Back
Top Bottom