Gossamer Forum
Home : General : Perl Programming :

case insensitive

Quote Reply
case insensitive
In would like to make the following routine case insensitive, so .doc, .DOC, .Doc, .Doc, .dOC will all pass. (and so on for .txt) Who can help me out?





Code:
my $attach_ext = '\.doc$|\.txt$';
if ($filename !~ /$attach_ext/) {
$attach_ext =~ s/\\//g;
$attach_ext =~ s/\$//g;
@ext = split (/\Q|\E/o,$attach_ext);
$attach_ext = join(" or ",@ext);
&site_html_request_error (" Only files with the following extension(s) are allowed: $attach_ext");
return;
}
Subject Author Views Date
Thread case insensitive cK 2398 Sep 13, 2000, 11:46 AM
Post Re: case insensitive
Stealth 2301 Sep 13, 2000, 12:52 PM
Post Re: case insensitive
Alex 2275 Sep 16, 2000, 12:45 PM