Home  |  Linux  | Mysql  | PHP  | XML
From:jhorwitz@cvs.perl.org Date:Sat Sep 27 12:38:06 2008
Subject:[svn:mod_parrot] r459 - mod_parrot/trunk/languages/perl6/lib/ModPerl6
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)
Navigate in group perl.cvs.mod_parrot at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants