Please be careful when you check for match in array:
#!/usr/bin/perl -w
use strict;
use warnings;
my @x=('manu','vinu','rinshad');
if("manu"~~@x) {
print "Success";
} else {
print "fail";
}
The above program will work fine in Perl V5.16. But there will be a warning message in Perl V5.18 and above. To overcome this issue, use following code :
#!/usr/bin/perl -w
use strict;
use warnings;
use experimental 'smartmatch';
my @x=('manu','vinu','rinshad');
if("manu"~~@x) {
print "Success";
} else {
print "fail";
}