[svn:mod_parrot] r514 - mod_parrot/trunk/languages/perl6/lib/ModPerl6

[email protected] Tue, 2 Dec 2008 14:20:57 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Tue Dec  2 14:20:57 2008
New Revision: 514

Modified:
   mod_parrot/trunk/languages/perl6/lib/ModPerl6/Registry.pm

Log:
use new :global support in substr


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	Tue Dec  2 14:20:57 2008
@@ -12,8 +12,8 @@
 sub gen_module_name($path)
 {
     my $name = $path;
-    # XXX replace with a proper global substitution when available in rakudo
-    $name .= subst(/<[\/\-]>/, '_') while ($name ~~ /<[\/\-]>/);
+    # sanitize the module name
+    $name .= subst(/<-[\w]>/, '_', :global);
     return "ModPerl6::Registry::Script::$name";
 }