in reply to Dereferencing complex data w/o intermediate variable

you would only want to get rid of line one in favor or a real accessor method.

so, you could do:

 my @names = @{ $r_cmds->{"names"} };

or, you could write a proper accessor method for the 'names' attibute ( if you have access to the original code that creates the 'r_cmd' object i assume you're using. )

untested code

sub names { my $obj = shift; my @names = @{ $obj->{'names'} }; return @names; }

then, you would just have lines one and two look like this:

sub go_cmds { my $r_cmds = shift; my @names = $r_cmds->names; ## do more stuff }