Every time I input something the code always tells me that it exists. But I know some of the inputs do not exist. What is wrong?
#!/usr/bin/perl @array = <&g
This could be done using List::Util's first function:
first
use List::Util qw/first/; my @array = qw/foo bar baz/; print first { $_ eq 'bar' } @array;
Other functions from List::Util like max, min, sum also may be useful for you
List::Util
max
min
sum