Subject: | little problem in restoring strings values |
Distribution: Beautifier
Version: 0.04
OS: never mind
Hello
To process the attached file I had to correct the last "reverse step"
to make it a "recursive-like" step.
When in same pattern many $randomString are replaced, the reverse step
treats only the first.
I added for my own the crappy following loop (line 169):
Show quoted text
> while ($fileContent =~ m/$randomString([0-9]+);/ && $counter --)
But there must be a better solution.
Subject: | listfct.pl |
use Data::Dumper;
my $root = 'D:\\Projets\\STS-Report_6.1w_perlis\\';
my $tmpfile = "M_YT_MPFILE";
my $doscmd = "dir /B /S $root\\*.p? > $tmpfile";
our @listfct = ();
unlink $tmpfile;
system ($doscmd);
open (MFILE , $tmpfile);
while (<MFILE>)
{
chomp;
next if (/recdescent\.pm/ || /old\.p./);
analyze ($_)if ((/\\cgi\\[^\\]*$/ || /\\scripts\\[^\\]*$/)&& !/\\cgi\\cgi\\/);
}
close (MFILE);
print join "", sort @listfct;
sub analyze ($)
{
my $mfile = shift;
open (LFILE , $mfile);
while (<LFILE>)
{
next if (/sub new/ || /sub AUTOLOAD/ || /sub code/ || /sub DESTROY/ || /sub code/);
(s/(sub\s*\w*).*// && push @listfct, "$1\t$mfile\t$.\n") if (/^sub\s*/);
}
close (LFILE);
}