|< 1 2 >| | 15 Einträge, 2 Seiten |
1
2
3
4
5
6
7
my %hash = (
'key' => [\%foobar, 1]
);
my $hashref = \$hash{key};
print 1 if exists $hashref;
print "yes" if defined $hashref
print "yes" if defined $hashref
1
2
3
4
5
6
7
my $hashref = \$hash{key2};
if (defined $hashref->[1]) {
$hashref->[0]->(\@args); # führt Subref aus, wenn Index 1 gleich wahr ist.
} else {
$hashref->(@args);
}
my $hashref = exists $hash{key} : $hash{key} : undef;
perl -e '%hash = (foo => ["bar", "foobar"]); $hashref = \$hash{foo};'
$$hashref->[1]
QuoteCode: (dl )perl -e '%hash = (foo => ["bar", "foobar"]); $hashref = \$hash{foo};'
1
2
3
%hash = (foo => ["bar", "foobar"]);
$arrayref = $hash{foo};
print $arrayref->[1] . "\n";
|< 1 2 >| | 15 Einträge, 2 Seiten |