in reply to Extending Array
An a additional possibility is to turn the HashRef into a hash variable and call a hash slice to add the next two key / value pairs. Read the perlvar detail on $; for more information
#!/usr/bin/perl use strict; use warnings; my $thing = { 'A' => 'hello', 'B' => 'there' }; #use a hash slice @$thing{'C', 'D'} = ('cutie', 'pie'); print "$thing->{'A'} $thing->{'B'} $thing->{'C'} $thing->{'D'}\n";
|
|---|