Ken Gillett wrote:
I want to pass a string to a subroutine and use that as the name of the hash to tie to a dbm file (or use dbmopen). But I can't make it work with a hash reference in the sub routine.

If I use the same code outside the sub or hard code the hash name (i.e. no ref) within the sub it all works perfectly.

Can anyone enlighten me how I can use the string within the sub to make the name of the hash variable, tie/dbmopen it and be able to use the hash outside the sub? 'Cos I'm stuck:-(

perldoc -q "How can I use a variable as a variable name"

perldoc -q "How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}"



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to