in reply to Elegantly dereferencing multiple references
return \(%x, %y, %z)
but if your goal is to modify these hashes, why don't you operate on the references without returning them?
use strict; use warnings; use Data::Dump; my %x = ( a => "red"); my %y = ( b => "green"); my %z = ( c => "black"); sub modfifyHash { my ($x, $y, $z) = @_; $x->{a} = "circle"; $y->{b} = "square"; $z->{c} = "rectangle"; return; } dd \(%x, %y, %z); modfifyHash( \(%x, %y, %z) ); dd \(%x, %y, %z);
now tested!
({ a => "red" }, { b => "green" }, { c => "black" }) ({ a => "circle" }, { b => "square" }, { c => "rectangle" })
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
added tested version
|
|---|