Don't ask to ask, just ask | |
PerlMonks |
Re^5: Output Repeats in the elsif statementby Kenosis (Priest) |
on Feb 14, 2013 at 03:13 UTC ( [id://1018669]=note: print w/replies, xml ) | Need Help?? |
...all i need it to say is Car Record Not Found once not multiple times... You have the following:
Indeed, if you have 10 non-matches within the foreach loop, "CAR RECORD NOT FOUND" will be printed 10 times. It seems, however, that you may be looking for something like the following:
This just uses $found as a flag; if it's not set (i.e., if the item wasn't found in the array), the "CAR RECORD NOT FOUND" message is printed only once.
In Section
Seekers of Perl Wisdom
|
|