-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'd like to know if this is possible and how would it be done. I have
a hash like:

my %hash=( var1 => 1,
            var2 => 2,
            var3 => 3
          );

and I would like to know how to set variables with each key & value:
foreach my $keys (keys(%hash)){
    \$$key=$hash{$key}; # something like this it's just orientative.
}


In fact the real problem is how to set up a variable whose name is the value of another variable. Can this be done?



Cheers,
m4c.




- -- ,----------------------------------------------------------------------.
| Common sense is the collection of prejudices acquired by age |
| eighteen. |
| -- Albert Einstein |
|----------------------------------------------------------------------|
| Labs. Technician | |
| Department of Telematic Engineering | Debian GNU/Linux Powered |
| Universidad Carlos III de Madrid | |
|-------------------------------------------| .--. |
| | |o_o | |
| _________ | .''`. |:_/ | |
| |~~ @| Marcos Lorenzo de Santiago | : :' : // \ \ |
| | ==== | E-mail: [EMAIL PROTECTED] | `. `' (| | ) |
| | ==== | Telephone: (+34) 91-624-9959 | `- /'\_ _/`\ |
| |_________| Web: www.it.uc3m.es/marcos | \___)=(___/ |
| | |
`----------------------------------------------------------------------'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/


iD8DBQFCUj+SckJQBlHCNUERAog9AJ9HvaWjPH7Bfx/zJRmarQDvF/OjoQCeLf1Z
QNHlQhiNVmsyt5820hPLgS0=
=BqsP
-----END PGP SIGNATURE-----
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to