|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Putting a filename as a parameter to a perl script then reading from it in the code?by johngg (Abbot) |
| on Dec 07, 2012 at 13:06 UTC ( #1007732=note: print w/ replies, xml ) | Need Help?? |
|
The nice thing about Perl is that it very often does what you want without you having to jump through hoops. If you supply a file name (or multiple file names) as an argument, Perl will automatically open the file for you so you can read it using an empty <> (readline) function. The following steps create a simple CSV file and an equally simple script to read it.
I hope this is helpful. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||