Thread Hashes in Array (4 answers)
Opened by Moritz at 2013-01-09 17:27

bianca
 2013-01-09 17:48
#164825 #164825
User since
2009-09-13
6992 Artikel
BenutzerIn

user image
Vielleicht hilft dir das:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;

my %hash = (a => 1);
my @array = (\%hash);
print Dumper(\@array)."\n";
print "key a: ".$array[0]{a};


Edit: Eingängiger finde ich sogar $array[0]->{a}, weil es die Referenz deutlicher hervorbringt.

Editiert von bianca: Edit ergänzt
Last edited: 2013-01-09 17:51:20 +0100 (CET)
10 print "Hallo"
20 goto 10

View full thread Hashes in Array