YaRness
04-27-2001, 11:13 AM
...written in perl of course. also strips blank lines. basically, it prints only lines of code and no comments or empties.
"./foo.pl < input > output"
use strict;
use warnings;
my $inequalc=0;
while (<> )
{
if ($inequalc)
{
/^\=cut/ and ($inequalc = 0)
}
else
{
/^\=[a-zA-Z0-9]+/ and ($inequalc = 1)
or /^\s*(?:\#.*)?$/
or print;
}
}
was trying to obfuscate it, but i kept running into logical problems. merf.
"./foo.pl < input > output"
use strict;
use warnings;
my $inequalc=0;
while (<> )
{
if ($inequalc)
{
/^\=cut/ and ($inequalc = 0)
}
else
{
/^\=[a-zA-Z0-9]+/ and ($inequalc = 1)
or /^\s*(?:\#.*)?$/
or print;
}
}
was trying to obfuscate it, but i kept running into logical problems. merf.