Is there a way to do an index function that is case-insensitive?

For example:

sub stripTag {
        my $startTag = $_[0];
        my $endTag = $_[1];
        while (index($content, $startTag)>0) {
                my $first = substr($content, 0, index($content, $startTag) );
                my $last = substr($content, (index($content, $endTag)+length($endTag) 
) );
                $content = $first.$last;
                }
        }

stripTag("<font",">");
stripTag("<FONT",">");

this code has to be called with each case variant, or I'd have to put a lot of IFs inside the SUB

James

ps, tips on improving the above coding welcome, I'm just starting to come to grips with Perl. I know there are modules that include similar functions, but I'm doing this as a learning exercise.

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to