in reply to Re: Re: Re: Re: use Module and case-insensitive file names
in thread use Module and case-insensitive file names
Here's my code. I hope you understand most of it:
#ifdef WIN32 if (strcmp(name + len - 3, ".pm")) { char *pkg; int slash_count = 0, i = 0; for (i = 0; i < len - 3; i++) { if (name[i] == '/') slash_count++; } /* "Foo/Bar.pm" + 1 (slash) - 3 (".pm") + 1 ("\0") */ pkg = malloc(sizeof(char) * (len + slash_count - 3 + 1)); slash_count = 0; for (i = 0; i < len - 3; i++) { if (name[i] == '/') { pkg[i + slash_count] = ':'; pkg[i + ++slash_count] = ':'; } else pkg[i + slash_count] = name[i]; } pkg[i + slash_count] = '\0'; if (!gv_stashpv(pkg, FALSE)) Perl_warner(aTHX_ WARN_MISC, "Package %s not found (did yo +u use the incorrect case?)", pkg); } #endif
_____________________________________________________
Jeff japhy Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: use Module and case-insensitive file names
by John M. Dlugosz (Monsignor) on Jul 31, 2001 at 01:59 UTC | |
by japhy (Canon) on Jul 31, 2001 at 02:06 UTC | |
by John M. Dlugosz (Monsignor) on Jul 31, 2001 at 02:16 UTC | |
|
Re: Re: Re: Re: Re: Re: use Module and case-insensitive file names
by John M. Dlugosz (Monsignor) on Jul 31, 2001 at 02:13 UTC | |
by japhy (Canon) on Jul 31, 2001 at 02:22 UTC |