- or download this
##################################
# complain.pl - find what's wrong with others' code fast!
...
# Get input program.
my $snippet = eval {local $/; return < >};
print $snippet if $verbose;
- or download this
foreach (@plugin_list) {
require $_ or warn "Plugin $_ failed to load";
}
- or download this
# Load plugins
@plugins = grep {
eval{require "plugins/$_.pl"} ? 1 : (warn("Plug-in $_ failed to lo
+ad.\n"), 0)
} @plugins;
- or download this
require Acme::Current;
# or
use Acme::Current;
- or download this
use Module LIST;
require EXPR;
- or download this
foreach (@plugin_list) {
$_->init;
}
- or download this
# Do the stuff
foreach (@plugins) {
$_->evaluate($snippet);
}
- or download this
# Initialization:
foreach (@plugins) {
$_->init if UNIVERSAL::can($_, 'init');
}
- or download this
#############################
# plugins/bench.pl
...
print timestr(timeit(400000, $snippet)), "\n";
}
1;
- or download this
$ ./complain.pl -p bench < snippet.txt
- or download this
package Context;
...
$self->{$plugin} = [] unless exists $self->{$plugin};
push @{$self->{$plugin}}, $opinion;
}
- or download this
# Start a new context;
my $ctx = Context->new;
...
foreach (@plugins) {
$_->evaluate($ctx, $snippet);
}
- or download this
sub evaluate {
my $pkg = shift;
my ($ctx, $snippet) = @_;
$ctx->addOpinion($pkg, timestr(timeit(400000, $snippet)));
}
- or download this
# Simple output.
...
print "The plugin $plugin ${verstr}says:\n";
print join '\n', map { "\t$_\n" } @$opinions;
}
- or download this
###############################
# plugins/grammar.pl
...
}
1;
- or download this
perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";\
for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'