in reply to Re^3: getting the name of a variable to use as string
in thread getting the name of a variable to use as string
and build a hash keyed by the column name (a, b, etc) without having to type each name twice more as inmy ($a, $b, $c, $d) = split(/\|/,$unloadrow);
This may seem lazy but I often have a dozen tables with twenty or more columns to deal with and it would be nice to avoid a lot of error prone and repetitious typing or even cobble up a subroutine to handle building the hash.$hash{'a'} = $a; $hash{'b'} = $b; ...
The goal is to build a hash of those hashes so I can look up individual field values to do analysis of the data.
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: getting the name of a variable to use as string
by tachyon (Chancellor) on Sep 21, 2004 at 00:54 UTC | |
by pmneve (Novice) on Sep 21, 2004 at 21:33 UTC |