#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my @foo = ( { 'name' => 'rover' }, { 'name' => 'felix' } ); # Modify the first hashref in @foo print Dumper (\@foo); $foo[0]->{'food'} = 'Scooby Snacks'; print Dumper (\@foo);
And so you have added a key to one of the hash references in your array.
In reply to Re: Updating hash using it's reference
by hippo
in thread Updating hash using it's reference ...
by karthikin2asic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |