if ($FileExt eq '.xlsx' || '.pdf'){
Unfortunately that doesn't work, although TIMTOWTDI (There's More Than One Way To Do It):
if ( $FileExt eq '.xlsx' || $FileExt eq '.pdf' )
{ print "Match!\n" }
if ( $FileExt =~ /^\.(?:xlsx|pdf)$/ )
{ print "Match!\n" }
use Quantum::Superpositions;
# OR
#use Perl6::Junction qw/ all any none one /;
if ( $FileExt eq any('.xlsx','.pdf') )
{ print "Match!\n" }
Perl 6 supports Junctions natively, but note that Perl 6 is a related but different language that I wouldn't call production ready yet.
Update: Added a word. |