Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

(stephen) Re: Short (and clever?) CSV-to-AoA

by stephen (Priest)
on Apr 23, 2001 at 20:24 UTC ( [id://74755]=note: print w/replies, xml ) Need Help??


in reply to Short (and clever?) CSV-to-AoA

Interesting...

The code seems to run just fine without the "unless". Doing the 'push' on it creates the inner list. (Tested.)

I'm afraid I found your description a bit misleading, since you're not actually reading comma-separated values. :) Your values are separated by spaces. You output a comma-separated value list of the columns in the database (without escaping or quoting any commas that might be in the data).

stephen

  • Comment on (stephen) Re: Short (and clever?) CSV-to-AoA

Replies are listed 'Best First'.
Re: (stephen) Re: Short (and clever?) CSV-to-AoA
by riffraff (Pilgrim) on Apr 23, 2001 at 21:18 UTC
    I would have to agree with this, and add that even if it was changed to split ',', it still wouldn't work on fields that have embedded commas (surrounded by double quotes).

    -l

Re: (stephen) Re: Short (and clever?) CSV-to-AoA
by scott (Chaplain) on Apr 24, 2001 at 00:05 UTC

    Hmmm ... it runs fine as is for me with Activestate.

    Sorry about the comma confusion, I was using 'CSV' in its generic sense (like Text::CSV_XS which handles much more than commas as field delimiters).

    There won't be any commas in the data. It's quite clean.

    I see I've (again) assumed that everyone could read my mind and knew everything I know about the problem, sorry.

      Yes, it runs fine with the unless() statement. What I was saying was that it also runs fine without the unless() statement. :)

      You might also want to take a look at Data::Table on CPAN.

      stephen

        Eeep! I could have sworn that it didn't but it certainly does today. Thanks! Now the code is even simpler.

        I'll look at Data::Table.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2025-01-21 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (61 votes). Check out past polls.