ANJAN PURKAYASTHA wrote:
Hi,
I have a question on creating array variables. I have a driver script that
takes as input the number of files to be processed (say 7). One of the
children scripts needs to create array variables based on how many files are
being processed (in this case 7). How do I code the following action into
the child script: read the number of files to be processed. based on this
number create a set of arrays say @array1, @array2....@array7"?
Appreciate your feedback.
TIA,
Anjan
What you are trying to do is called a symbolic reference (see `perldoc
perlref` for details). It is consider to be not a good practise.
Instead, use a hash:
my %hash;
for my $name ( @file_names ){
$hash{$name} = [];
}
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/