Hi All,
I wrote a perl script using Tie::Handle::CSV to process a bunch of data in a csv file and print out only what I need into a new csv file. Right now, I print out the header line with all of the field names by just a hardcoding it in like so:
print '"TERM", "STUDENT ID", "NAME", ..."'."\n";
I suspect this is a dumb way of doing this, but I don't know how to get access to the header from within the Tie::Handle::CSV object. It's instantiated like so,
my $fh = Tie::Handle::CSV->new($file,header=> 1);
and data is accessed like so,
$line -> {'CATALOG_NBR'}
I know enough to know this is a hash-reference, but not enough to know how to print the header using this rather than hardcoding it. Obviously, "they" usually change the precise column names and ordering just after I get the script working again each term.
Thanks a lot for any help! JA