In that case you will need to alter the inner hashrefs, not the outer array, viz:
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my @eventrecords = ( { eventid => 2667 }, { eventid => 2666 }, { eventid => 2656 } ); for my $i (0 .. $#eventrecords) { $eventrecords[$i]->{line} = $i + 1; } print Dumper \@eventrecords;
In reply to Re^13: Compare 2 XML files
by hippo
in thread Compare 2 XML files
by snehit.ar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |