Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
[choroba]: Good afternoon!
[GrandFather]: Good evening
[choroba]: Anyone from the East coast to say Good night?
[Discipulus]: still off place choroba?
[choroba]: till the end of the week

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-02-27 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (376 votes). Check out past polls.