in reply to Parse .csv file
You can return multiple results as:
Of these, I'd pick one of the references as these package the data and you're only passing around a single scalar value. Further, I'd choose the hashref over the arrayref because you're not restricted to the order of the results and dealing with the returned values is easier and more readable. Consider:
my $h = hlookup(...); # First cell value with arrayref my $first_cell = $h[1]; # First cell value with hashref my $first_cell = $h{first_cell};
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse .csv file
by Sherlock Perl (Novice) on Jul 10, 2012 at 21:01 UTC | |
by kcott (Archbishop) on Jul 10, 2012 at 22:48 UTC | |
by aitap (Curate) on Jul 10, 2012 at 21:44 UTC |