Readers: 2
|< 1 2 3 4 >| | 31 entries, 4 pages |
1
2
3
4
$Hash{Array}[0] = "abc";
$Hash{Array}[1] = "xyz";
print "content-type: text/html\n\n";
print "$Hash{Array}[1]";
print $#Hash{Array};
$Hash{Array} = @Array;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Data::Dumper;
my %hash = ();
my @array = qw(1 2 3 4 5);
$hash{Array} = \@array;
#anzahl der elemente des arrays im hash
my $anzahl = scalar(@{$hash{Array}});
#alle elemente ausgeben
foreach(@{$hash{Array}}){
print $_;
}
# einzelnes element (4.) ausgeben
print $hash{Array}->[3];
# datenstruktur ausgeben
print Dumper(\%hash);
$HashTwo{ArrayTwo} = \@{$Hash{Array}};
$HashTwo{ArrayTwo} = \@{$Hash{Array}};
$HashTwo{ArrayTwo} = $Hash{Array};
$HashTwo{ArrayTwo} = [ @{ $Hash{Array} } ];
|< 1 2 3 4 >| | 31 entries, 4 pages |