Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: script to do a foreach on an array of strings outputting the title row and each string element verticallyby GrandFather (Saint) |
on Dec 28, 2015 at 21:23 UTC ( [id://1151292]=note: print w/replies, xml ) | Need Help?? |
First up, you should really use a module for handling your tab separated data. Next, think in terms of read a record and print it. Then you get something like:
Prints:
The @{...} stuff turns the array reference returned by Text::CSV::getline() into a list. The // [] bit in the while loop suppresses a warning by turning the end of file undef into an empty array.
Premature optimization is the root of all job security
In Section
Seekers of Perl Wisdom
|
|