[svn:mod_parrot] r459 - mod_parrot/trunk/languages/perl6/lib/ModPerl6
[email protected] Sat, 27 Sep 2008 11:38:06 -0700 (PDT)
| Newsgroups | perl.cvs.mod_parrot |
|---|---|
| Message-ID | <[email protected]> |
Author: jhorwitz
Date: Sat Sep 27 11:38:05 2008
New Revision: 459
Modified:
mod_parrot/trunk/languages/perl6/lib/ModPerl6/Registry.pm
Log:
replace kludgy split/join path sanitization with less-kludgy substitution
Modified: mod_parrot/trunk/languages/perl6/lib/ModPerl6/Registry.pm
==============================================================================
--- mod_parrot/trunk/languages/perl6/lib/ModPerl6/Registry.pm (original)
+++ mod_parrot/trunk/languages/perl6/lib/ModPerl6/Registry.pm Sat Sep 27 11:38:05 2008
@@ -8,15 +8,10 @@
sub gen_module_name($path)
{
- # until we have substitutions, use split/join to sanitize the path.
- my @pieces = split('/', $path);
- my $name = join('_', @pieces);
- @pieces = split('-', $name);
- $name = join('_', @pieces);
-
- my $mod = "ModPerl6::Registry::Script::$name";
-
- return $mod;
+ my $name = $path;
+ # XXX replace with a proper global substitution when available in rakudo
+ $name .= subst(/<[\/\-]>/, '_') while ($name ~~ /<[\/\-]>/);
+ return "ModPerl6::Registry::Script::$name";
}
sub handler($r)