in reply to Use of uninitialized value $data

Did you have a look at chunk 2147?

Why don't you print $line if not defined $data; ?

Even better use Data::Dumper to check for unexpected characters.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice