chris wrote:
How do I do the following without getting the message
Can't use string as hash ref while strict refs in use

use warnings;
#use strict;
my($a, @b, $c);
$a = '20020603';
$b[1] = 'name1';
$b[2] = 'name2';
$b[3] = 'name3';
my %h;
$h{$a} = $a;
$h{$a} = {};

Or leave this line out all together.

$h{$a}->{$b[1]}= 1;
$h{$a}->{$b[2]}= 2;
$h{$a}->{$b[3]}= 3;
print $h{$a}->{$b[1]} . "\n";
print $h{$a}->{$b[2]} . "\n";
print $h{$a}->{$b[3]} . "\n";

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to