Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Pls help: Appending/Joining words
I was trying to join words here with this short program i wrote but it does not do what i expect.I want it to append the word "sp" on each input line form a file and put tha results on the other file.
If the input file is like this:
BEDS b eh d z
BEEN b iy n
Then the output file should look like this:
BEDS b eh d z sp
BEEN b iy n d s sp
Here is the program I wrote:
# open prompt file
open my $fh, "< $words" || die ("Unable to open prompt file $prompt");
open my $wfh, "> $out" || die ("Can't create output file!");
while ( $word = <$fh>)
$info=join $word,' ',$w1;
print $wfh "$info";
Thanx in advance!
0 · ·