in reply to Re^2: Why a reference, not a hash/array?
in thread Why a reference, not a hash/array?
You understand, that when you do a:
that's just making a copy of a scalar value, but if you do a:$working_href = $returned_href;
that makes a copy of the entire data-structure. That doubles you memory usage, and wastes time in making the copy... so you don't want to do that unless you have a really good reason (like you're planning on modifying the copy and you need to preserve the original).%working = %returned;
By the way, if you need to join an array given a reference to it, you just do this:
There's no "extra step" you need to do.my $string = join " ", @{ $aref };
|
---|