in reply to dynamically initializing variables with perl
Looks like you want to have variables called $C1, $C2, a.s.o.
Thanks to Hofmator for this catch.
Normally you use an array for things like that:
or without the for loop:my @C; for (my $i=0; $i< $msgcount; $i++) { $C[$i] = param("C$i"); }
Update: Changed $C[0] to $C[$i]my @C = map { param("C$_") } 0..$msgcount - 1;
Thanks to Hofmator for this catch.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: dynamically initializing variables with perl
by chromatic (Archbishop) on Jan 07, 2003 at 17:45 UTC | |
by busunsl (Vicar) on Jan 08, 2003 at 06:59 UTC | |
by chromatic (Archbishop) on Jan 08, 2003 at 17:33 UTC | |
Re: Re: dynamically initializing variables with perl
by db2admin (Acolyte) on Jan 08, 2003 at 05:18 UTC | |
by busunsl (Vicar) on Jan 08, 2003 at 07:03 UTC | |
by db2admin (Acolyte) on Jan 10, 2003 at 04:34 UTC |
In Section
Seekers of Perl Wisdom