#!/usr/bin/perl
#package Perl_Run
use strict;

use Benchmark ':hireswallclock';

my $console = "$ENV{HOME}/.xsession-errors";
open CONSOLE, ">>$console";

sub main {
	my $file    = shift;
	my $command = "";

	if ( $file =~ m|(.*?/cpan/.*?/lib/)|o ) {
		$command = qq|perl -I '$1' '$file' 2>&1|;
	} else {
		$command = qq|perl -I ~/perl '$file' 2>&1|;
	}

	my $count = 1;
	print CONSOLE "Benchmark $file . . .\n";
	my $t = timeit( $count, qq(
		my \$output = qx($command);
		\$output =~s/(?:Constant )?[Ss]ubroutine.*?redefined.*\n//sgo; # remove 'Subroutine ??? redefined at ??? line ???.' warning
		print \$output;
	) );
	print CONSOLE timestr($t), "\n";
}

&main($_) foreach @ARGV;

END {
	close CONSOLE;
}

__END__
	my $count = 1;
	system "make manifest 2>&1 | grep OK";
	system "perl Makefile.PL | grep OK";

NEdit -> Preferences -> Default Settings -> Customize Menus -> Shell Menu
Shell Menu:

Menu Entry: 		Perl>Run
Command Input: 	none
Command Output: 	dialog

Save file before executing command: 	true

Shell Command to Execute:
/home/holger/perl/cpan/Weed/nedit/perlrun '%'
