3

I want to check if a file exist in Perl. This can be done using (-e $filename). But this is case sensitive. How can I check for case insensitive. I have to use only core package to achieve this.

Anthon
  • 69,918
  • 32
  • 186
  • 246
Omkar
  • 51
  • 5

1 Answers1

-1

Stolen from here.

(grep {/$file/i} <$dir/*>) or die "$file not exist in $dir\n";
serenesat
  • 4,611
  • 10
  • 37
  • 53