Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Parsing CSV only returns the second line of the file

by Athanasius (Monsignor)
on Sep 01, 2012 at 10:19 UTC ( #991142=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Parsing CSV only returns the second line of the file
in thread Parsing CSV only returns the second line of the file

The reason it wouldn't compile (works fine for me) is because I have perl as a part of proprietary mining software which has their own extension modules installed, e.g. Lava. I don't get any errors or warnings when running it.

Then what you posted isn’t exactly what you’re running, since this line in the original post (fixed in the new post, I see):

if ($csv->parse($_)

is missing a closing parenthesis, and the final line:

END;

should be __END__.

It says next if line number equals to 2?

No, array elements start counting at zero, but line numbers begin at one. So that statement says: Skip the first line of data. (Presumably, the original code expected the first line to be a heading?)

You are making progress, but it’s difficult to say why your code is failing without a complete, self-contained script. Also, detailing the output you expect/desire would help the monks know what you are trying to achieve. Please see How do I post a question effectively?.

Update: Minor edit.

Athanasius <°(((><contra mundum


Comment on Re^3: Parsing CSV only returns the second line of the file
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991142]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-10-02 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (65 votes), past polls