Make sense?
Not really. There are now two variables named city (one localized to the loop and a new one in the outer scope), and one of them is always undef.
The purpose of the loop is to validate $inner_city, so why is $city being printed? Fix:
foreach my $city ( @myCities ) { # $city is local to this loop only! } print "$inner_city";
In reply to Re^2: **HomeWork** Printing the found input from an array
by ikegami
in thread **HomeWork** Printing the found input from an array
by trenchwar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |