c_lhee has asked for the wisdom of the Perl Monks concerning the following question:
HOWEVER, if the @array and @TheArray were substituted with the values of#list $array_lenth = @array = ("perl.a", "perl.b", "perl.c"); $array_lenth = $array_lenth -1; for ($i = 0; $i <=$array_lenth; $i++) { $element = $array[$i]; print "--value of $i element = $element \n"; #values to match @TheArray = qw(perl.a perl.b perl.c); if (grep {$_ eq $element} @TheArray) { print qq(<td>Found '$element' element!</td>\n); $element =[$_]; } else { print "NOT FOUND '$element' element!\n" ; $element =[$_]; }; }
which is now$dummy_a = $input{'dummy_a'};
THEN, set as$dummy_a = "perl.a perl.b perl.c perl.d perl.e";
THE list in $dummy_a is recognized as a value from one element only...Therefore I cannot count and compare the list. Why is that. c_lhee@yahoo.com@array = $dummy_a; or @TheArray = $dummy_a;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Comparing and Counting Arrays Length
by merlyn (Sage) on Apr 08, 2003 at 07:23 UTC | |
by c_lhee (Novice) on Apr 08, 2003 at 09:00 UTC | |
by Abigail-II (Bishop) on Apr 08, 2003 at 09:09 UTC | |
|
Re: Comparing and Counting Arrays Length
by c_lhee (Novice) on Apr 08, 2003 at 09:07 UTC |