File is adding one extra space in each line

Posted by SCNCN2010 on Stack Overflow See other posts from Stack Overflow or by SCNCN2010
Published on 2010-06-10T16:06:21Z Indexed on 2010/06/10 16:42 UTC
Read the original article Hit count: 250

Filed under:

I am trying to add all the elements in array using push . then i stored into another file

but begining of file i am seeing one whitespeace in every thing ..

What is the issue .. any one before face this issue .

open FILE , "a.txt"

while (<FILE>)
{

  my $temp =$_;

  push @array ,$temp;

}
close(FILE);

open FILE2, "b.txt";
print FILE2 "@array";
close FILE2;

© Stack Overflow or respective owner

Related posts about perl