http://www.perlmonks.org?node_id=855017


in reply to uninitialized string variable

Unfortunately, you usually can’t guarantee the quality of the input data that you are being asked to process.   Furthermore, it might or might not be “okay” to “just skip” the bad ones.

Ex minimis, you will need to trap the exceptions that may occur, and attempt to recover gracefully.   More likely, you will have to process the input files twice... first to verify data integrity, then to process it.

Replies are listed 'Best First'.
Re^2: uninitialized string variable
by apl (Monsignor) on Aug 14, 2010 at 14:31 UTC
    At the very least, the first step to debugging would be for the OP to print out (delimited) what was read, what the contents of $data looked like, etc.