in reply to Script Hanging w/Data::Dumper and Text::CSV_XS

Your script works fine for me. You should add an else clause onto the parsing to see if parsing fails (perhaps the line endings aren't what you expect). Something like
if($csv->parse($line)){ ... } else { die $csv->error_input }

BTW, if this is a CGI, did you print the content-header someplace else? Because if you didn't, trying to print the Dumper without a content header will not do what you want.

Replies are listed 'Best First'.
Re^2: Script Hanging w/Data::Dumper and Text::CSV_XS
by Fletch (Bishop) on Nov 11, 2004 at 00:43 UTC

    His dump prints are going to stderr (and hence into the server's error log) so that shouldn't make a difference one way or the other.

Re^2: Script Hanging w/Data::Dumper and Text::CSV_XS
by saberworks (Curate) on Nov 11, 2004 at 00:59 UTC
    I have the error checking on my script, I omitted it here because I didn't want the code to be too long. The thing is, the parsing is working fine. The problem is, when I assign the result of the fields() function to some array, and then later use fields() again to a different array, I can't get at the data in the first array. It seems almost like a memory management issue behind perl somewhere because I'm carefully and correctly using scoping here and the array names aren't in conflict at all. I even tried copying the results to a new array but that gives me the hanging as well. If the code is working fine on your machine, I'm betting that it has to be something wrong with the installation or something on my machine :(