Here is my code which takes inputs from command line.
my ($item, @l1) = @ARGV; print ((grep $item eq $_ , @l1) ? "found" : "sorry");
Inputs can be:
$ perl code.pl 23 24 25 23 #outputs "found"
$ perl code.pl perl monks are great #outputs "sorry"
In reply to Re: Better way to write these checks?
by uday_sagar
in thread Better way to write these checks?
by Ransom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |