$self->doSomething({
record => $record,
listing => [ $foo, $bar, $baz ],
passedargs => { something => $val, another => $val2 }
});
accessing args within a hashref.
So if I wanted to access record I would
my $record = $args->{record};
If I wanted to access listing I would
my @listing = $args->{listing};
How would I access Passedargs? If I just wanted to access "something" or "another"?
If you want assign the values in
listingto an array, please note that you'll need to dereference it:To access the fields in
passedargs, you simply need to use the following syntax:For more details, take a look at: perldsc - Perl Data Structures Cookbook