Put your "my %player;" inside the while loop. Try with the following code, then uncomment that "my %player;" outside the loop, comment out the inside one and try again.
use Data::Dumper; use strict; use warnings; my @players; #my %player; for my $index (1 .. 10){ my %player; $player{'a'}=$index; push (@players, \%player); } print Dumper(\@players);
In reply to Re: Array of Hashes question
by pg
in thread Array of Hashes question
by no21
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |