Dear List I have a source file as follows hello how are you? hello how are you? What language did you want to use? What language did you want to use? I am here You are there this is my first perl script What language did you want to use? #################################################### I want to write a script which will take a single line from the filehandel and print the line without any space between words of that line I have written a code as follows( I can achieve this by using an array but I don't want to use an array)
use strict; use warnings; my $fname="/home/anadhikary/perl/file1.txt"; open my $FH,'<',$fname; while(<$FH>) { my ($line)=split(/\s+/,$_); print $line."\n"; } close($FH); But this code prints only the first words of every line.... Where I am making the mistake??? Thanks&Regards in advance Anirban Adhikary.