Cagliostro
Programmer
Hi,
I'm not a perl programmer, but I have to sole this.
I'm having problems with ararys of hashes and would know how to solve it:
the second output is simething like this:
.....
{HASH(0x1f1d87c):}
{HASH(0x1f1d8ac):}
{HASH(0x1f1d8dc):}
{HASH(0x1f1d90c):}
{HASH(0x1f1d93c):}
{HASH(0x1f1d96c):}
{HASH(0x1f1d99c):}
....
Ion Filipski
I'm not a perl programmer, but I have to sole this.
I'm having problems with ararys of hashes and would know how to solve it:
Code:
my @all_users;
....
while(reading data from somewhere)
{
my %single_user;
my $user = $atts{"name"};
$single_user{'group'} = $group;
$single_user{'user'} = $user;
#with the hash there everithing is fine:
print $single_user{'group'}.':'.$single_user{'user'}."\n";
push(@all_users, \%single_user);
}
.....
#reading the array of hashes elsewhere:
for(my $i = 0; $i < scalar(@all_users); $i++)
{
...
my %single_user = $all_users[$i];
...
my $k;
foreach $k(keys %single_user)
{
#a very strange outout
printf "{" . $k . ":" . $single_user{$k} . "}";
}
....
}
....
.....
{HASH(0x1f1d87c):}
{HASH(0x1f1d8ac):}
{HASH(0x1f1d8dc):}
{HASH(0x1f1d90c):}
{HASH(0x1f1d93c):}
{HASH(0x1f1d96c):}
{HASH(0x1f1d99c):}
....
Ion Filipski
