(Randal L. Schwartz) wrote:
"Gunnar" == Gunnar Hjalmarsson <[EMAIL PROTECTED]> writes:

Gunnar>         my ($comp) = /([^,]*,[^,]*,[^,]*)/;
Gunnar>         $Llist{$comp} = $_;

These lines scare me.  What happens if the regex fails?

And if you never expect it to fail, at least add a "die", to prove
me wrong. :)

Well, I thought that a record in a CSV file with 82 fields ought to contain at least two commas, but

    my ($comp) = /([^,]*,[^,]*,[^,]*)/
      or die "Parsing of line $. in '$Lfile' failed";

OTOH, the OP should consider a more robust method to parse the records anyway.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to