- or download this
LIAM:~$ perl
push(@a, 'a');
push(@a, 'b');
$foo{stuff} = @a;
print $foo{stuff} . "\n";
- or download this
$myhash{$key1}=\@value1
- or download this
$myhash{$key1} = {'abd' => 1, 'bcd' => 2, ...};
- or download this
sub add_set
{ # adds a set if it's unique, otherwise does nothing.
...
}
$$mhash{$new_hashid} = \%endhash; # Otherwise, add it
}
- or download this
my %foo;
$foo{set1} = {a=>'beta', 'c'=>'gamma'};
add_set(\%foo, "set2", 'beta','gamma');
add_set(\%foo, "set3", 'moo', 'cow');
print join("\n", keys %foo);