in reply to Subroutines: Returning a hash vs. hash reference
# %output is the hash that will be passed to Template. $output{user_details} = get_user_details( $user_id );
This allows you to send data straight through to Template without having it hang around in your script. You could certainly do the same with a function that returns a normal hash with a step in between, but it is easier to standardise on hash refs and then to know that you can always do the above.
|
|---|