money where my mouf is

git-svn-id: file:///home/svn/incoming/trunk@2688 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Spoon M 2005-07-09 21:14:53 +00:00
parent 5777ef8730
commit 2067f08051
1 changed files with 8 additions and 10 deletions

View File

@ -1,18 +1,16 @@
#!/usr/bin/perl
#!/usr/bin/perl -pi.bak
use strict;
while(<STDIN>) {
my $line = $_;
s/require '(.*?)'/"require '" . waka($1) . "'"/ge;
if($line =~ /require '(.*?)'/) {
my $required = $1;
sub waka {
my $required = shift;
my @pieces = split('/', $required);
map { $_ = old_to_new($_) } @pieces;
my $new = join('/', @pieces);
my @pieces = split('/', $required);
map { $_ = old_to_new($_) } @pieces;
my $new = join('/', @pieces);
print "$required -> $new\n";
}
return $new;
}
sub old_to_new {