in reply to More efficient return of values from sub

bradcathey,
Your getinfo example doesn't reflect what expensive operations you are trying to avoid nor have you indicated what level of visibility (scope) you need. To summarize the examples provided so far:

Without knowing more information, I would make a few assumptions and not have a getinfo() sub at all.

#package declaration if applicable my %info = ( name => expensive_op1(), address => expensive_op2(), ); # later on in the code sub routine_A { print $info{name}; }

Cheers - L~R