Sucking the hash into a ref would be smarter if it were passed as a ref:
# Call as $obj->foo( { keys => values } ) sub foo { my( $obj, $params ) = @_; # .. }
but here it is not called like that. Indeed, davidrw's code $params = { @_ } copies the hash, as it must, since it is passed that way.
Your other idea is good.
In reply to Re^4: Hashes and keys...
by kaif
in thread Hashes and keys...
by mkenney
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |