Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Read from file to two arrays.

by jonadab (Parson)
on Apr 15, 2007 at 12:04 UTC ( #610179=note: print w/replies, xml ) Need Help??

in reply to Read from file to two arrays.

If parsing the CSV is an issue at all, you might have a look at Text::CSV. It might not be necessary, if your data are sufficiently simple, and you might get by with split as GrandFather suggests, but the first time one of the values contains an embedded comma or breaks your assumptions in some other weird way, you'll have a bug, and at that point you'll end up switching to using the CSV-parsing module to fix the bug. If that's at all likely, wouldn't it be easier to just use the module in the first place?

Of course, if you have control over the way the data are generated, then you may be able to guarantee that will never happen, in which case split is fine and Bob is your uncle.

We're working on a six-year set of freely redistributable Vacation Bible School materials.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://610179]
[james28909]: thanks
[james28909]: what i am trying to do is track state of a chat based application. i need to be able to store the channels and such for a user, and when they join a new server/channel i need to be able to update that feild.
[james28909]: do you think OO would best suite that?
[karlgoethebier]: james28909: The last two are not mainstream. You have been warned ;-)
[karlgoethebier]: james28909: I don't know. Try it.
[james28909]: foreach server this bot is on, the gateway sends me a json response, which i parse out all the info with JSON, and this response has user information, i need to be able to add a user, and then update the user info when they join/leave rooms ect

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-05-25 16:33 GMT
Find Nodes?
    Voting Booth?