Alberto,

let's start with something very basic:
DO NOT use variables as variable names!

seeing MJD already wrote a very nice piece about why that's a bad idea, i'll just refer
you to his site:
http://perl.plover.com/varvarname.html

Now, what *should* you do?

1. if you want multiple values for $varname but all want them to point at a certain
(maybe same) array, use hashes

like this:
my @names = qw(name1 name2 name3);
my @values = qw (value1 value2 value3);

for (@names) {    $hash[$_] = \@values    }

2. you want to use multiple names for the $varname, but also the contents of the array
may vary:
in that case, read up on how to use hashes and references.
perldoc perlre would help you out, or read the tutorials on
www.sharemation.com/~perl/tut


Regards,

Jos Boumans

Alberto Manuel Brandao Simoes wrote:

>         Hellows
>
>         I'm writing a module and, as all modules should be, I'm using strict. So, I
> need to 'declare' every variable. What I want, is to do something like:
>
>         $varname = "myvar";
>         @$varname = ('a','b','c');

Reply via email to