in reply to variable array names
You probably don't want to be using the symbolic references to be doing this, they are generally considered evil and unnecessary in most applications. Instead you probably want to be using a hash - something like:
Of course that is untested as I don't have your data.$element_count=0; my %CLIQUE_DETAILS; foreach $element (@CLIQUE_ID_START_LINES) { if ($element != $CLIQUE_ID_START_LINES[$#CLIQUE_ID_START_LINES]) { for ($i = $element; $i<=$CLIQUE_ID_START_LINES[$element_count+1] +; $i++) { if ( not exists $CLIQUE_DETAILS{$element_count} ) { $CLIQUE_DETAILS{$element_count} = []; } push(@{$CLIQUE_DETAILS{$element_count}}, $VCONFIG[$i]); } $element_count++ }
/J\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: variable array names
by Eimi Metamorphoumai (Deacon) on Oct 15, 2004 at 14:57 UTC | |
by Makarczyk (Initiate) on Oct 18, 2004 at 15:50 UTC |