use File::Basename; while (<DATA>) { chomp; ($name,undef,$suffix) = fileparse($_,'.xlsx','.pdf'); print "$name$suffix\n" if $suffix; } __DATA__ perl.pl tar.tgz excel.xlsx pdf.pdf ruby.rb
In reply to Re: How to look for two different file extensions?
by Anonymous Monk
in thread How to look for two different file extensions?
by Superbroom2.0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |