in reply to Re^4: getting the name of a variable to use as string
in thread getting the name of a variable to use as string
As noted before you almost never want to do it the way you described. Hash slice syntax is what you want.
my %h; my @cols = qw( a b c d ); @h{@cols} = split ' ', 'does this do it?'; use Data::Dumper; print Dumper \%h; __DATA__ $VAR1 = { 'a' => 'does', 'b' => 'this', 'c' => 'do', 'd' => 'it?' };
If you designed this database it is worth noting that each column in a RDBMS should be atomic ie you should not be storing pipe delimited data and then breaking it out as you loose a lot of power.
cheers
tachyon
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: getting the name of a variable to use as string
by pmneve (Novice) on Sep 21, 2004 at 21:33 UTC |