App-dategrep
view release on metacpan or search on metacpan
build-standalone view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my $target = 'dategrep';
open( my $standalone, '>', $target) or die "Can't open target: $!\n";
sub wanted {
return unless -f;
open( my $fh, '<', $_ )
or die "Can't open $_: $!\n";
while (<$fh>) {
next if /^use App::dategrep/;
next if /^eval "require/;
s/^use parent 'App/use parent -norequire, 'App/g;
next if /^=pod/ ... /^=cut/;
print {$standalone} $_;
}
}
my $script = 'script/dategrep';
open( my $fh, '<', $script ) or die "Can't open $script: $!\n";
while (<$fh>) {
next if /^use App::dategrep/;
print {$standalone} $_;
}
finddepth( \&wanted, 'lib' );
chmod 0755, $target;
exit 0;
( run in 0.765 second using v1.01-cache-2.11-cpan-39bf76dae61 )