M
m
i checked the archives, but couldn't find anything that made sense to
me (blush). this is a generalized example of my problem:
i have a set of 100 lists:
@list1 = ...
@list2 = ...
@list3 = ...
@list4 = ...
@list5 = ...
....
@list 99 = ...
@list100 = ...
i want to then check a value to see what list it's in. instead of
writing 100 of these:
foreach $list1 (@list1) {
if $value =~ /$list1/ {
print "found the value in list1\n";
}
}
i want to put that in a loop that runs 100 times. in my mind, it
seems like i will be calling a list by a variable name that increments
$listTrigger = "list"
$counter = 1;
$listTrigger .= $counter;
until ( !exists @$listTrigger) {
if $value =~ /$list1/ {
print "found the value in $listTrigger\n";
}
++$counter;
}
i receive the following message: Can't use string ("list1") as an
ARRAY ref while "strict refs". any help would make me the happiest
boy on the planet.
matt
me (blush). this is a generalized example of my problem:
i have a set of 100 lists:
@list1 = ...
@list2 = ...
@list3 = ...
@list4 = ...
@list5 = ...
....
@list 99 = ...
@list100 = ...
i want to then check a value to see what list it's in. instead of
writing 100 of these:
foreach $list1 (@list1) {
if $value =~ /$list1/ {
print "found the value in list1\n";
}
}
i want to put that in a loop that runs 100 times. in my mind, it
seems like i will be calling a list by a variable name that increments
$listTrigger = "list"
$counter = 1;
$listTrigger .= $counter;
until ( !exists @$listTrigger) {
if $value =~ /$list1/ {
print "found the value in $listTrigger\n";
}
++$counter;
}
i receive the following message: Can't use string ("list1") as an
ARRAY ref while "strict refs". any help would make me the happiest
boy on the planet.
matt