Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Putting a filename as a parameter to a perl script then reading from it in the code?

by space_monk (Chaplain)
on Dec 07, 2012 at 13:33 UTC ( #1007734=note: print w/replies, xml ) Need Help??


in reply to Putting a filename as a parameter to a perl script then reading from it in the code?

Please use Text::CSV or one of its friends to read your CSV file. An example of how to read a CSV file is in the CPAN documentation. Whilst you can simply split on commas as the previous example by johngg showed, it doesn't cater for quoted fields within CSV files. The most important thing to learn about Perl is not that There's More Than One Way To Do It (TMTOWTDI), it is that Someone Has Almost Certainly Done It Before, so use libraries where possible.

A Monk aims to give answers to those who have none, and to learn from those who know more.
  • Comment on Re: Putting a filename as a parameter to a perl script then reading from it in the code?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007734]
help
Chatterbox?
[ambrus]: Corion: really? Does that mean the Prima watcher objects behave as handles that stop the watcher when they're destroyed, just like AnyEvent expects?
[ambrus]: "all the bugs" -- hehe, good luck
[ambrus]: Corion: what I don't understand is, if you make a one-shot AnyEvent timer with short timeout, does this code guarantee that the Prima timer can't queue two timeout events before invoking any of them?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-12-09 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (149 votes). Check out past polls.