@array = ("a1 b1","a2 b2","a3 b3","a5 b5","a4 b4"); print "product?\n"; chomp($prod = <>); foreach(@array){ @items = split(/ /,$_); if($items[0] eq $prod){ print $items[1]; } }
In reply to Re: search and return values from an array
by Anonymous Monk
in thread search and return values from an array
by Gtforce
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |