Next Tricks of the Wizards 102

Case-Insensitive Function Calls

        sub closethewindow { ... }
        sub AUTOLOAD {
          my ($package, $func) = ($AUTOLOAD =~ /(.*)::(.*)/);
          my $true_func = join '::', $package, lc $func;
          goto &$true_func if defined &$true_func;
          croak "Undefined subroutine &$AUTOLOAD";
        }


Next Copyright © 2003 M. J. Dominus