Rajeev Prasad wrote:
plz. advice why am i getting this error?

Because the filehandle OUT_FH has NOT been opened correctly!


I have checked:
varilable outfile has proper path/filename

How have you checked that?


array allrecords has data

How have you checked that?


open(OUT_FH,">","$outfile");

You shouldn't quote variables:

perldoc -q quoting

You should verify that open() worked correctly before trying to use a possibly invalid filehandle:

open OUT_FH, '>', $outfile or die "Cannot open '$outfile' because: $!";


print OUT_FH "@allrecords";

Did you really want to interpolate that array?

perldoc -q "Why do I get weird spaces when I print an array of lines?"


close OUT_FH;

error:
print() on closed filehandle OUT_FH at /...



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to