Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (16)
As of 2014-09-18 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls