Acme-RunDoc

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

       Acme::RunDoc->use($module1, @args1);
       Acme::RunDoc->use($module2, %args2);
       Acme::RunDoc->use($module3);
     }

    is:

     use Acme::RunDoc
         $module1  => \@args1,
         $module2  => \%args2,
         $module3  => undef;

    (See the sections on `use`, `import` and `require` in perlfunc if any of
    that confuses you.)

SEE ALSO
    icrosoft::Word, Text::Extract::Word.

AUTHOR
    Toby Inkster <tobyink@cpan.org>.

foo.pl  view on Meta::CPAN

split sprintf reverse times xor not eval and srand
tell sqrt formline eval ord lcfirst ucfirst length
 glob gmtime exp defined caller or binmode log ord
abs lc sqrt study alarm split time or formline cos
ne rewinddir kill chdir reset prototype split sqrt
ord int localtime abs oct pack pop eq scalar print
telldir open unpack return and unlink write chroot
hex bless utime split chown split close rmdir join
exp fileno getc sleep redo glob mkdir stat ne pack
reverse getpwnam next lstat gethostent and getpgrp
 eq log ord time xor chr undef and eval caller and
printf srand lstat chown chdir syscall open select
eq -w closedir sleep chr split and quotemeta reset
require ne closedir sleep chr undef or pack unpack
length splice shift umask readpipe pos xor defined
 join system and die or do exit if defined require
hex defined undef or sprintf localtime cmp time or
abs time and undef and open exp getc fileno system
caller eof rewinddir readpipe splice shift defined
kill pop wantarray and readlink eof readpipe split
eval warn join study abs localtime oct log time or
reverse xor open 0; print chr ord while readline 0
,;print chr abs length time for cos length getppid

foo2.pl  view on Meta::CPAN

not exp log srand xor s qq qx xor
s x x length uc ord and print chr
ord for qw q join use sub tied qx
xor eval xor print qq q q xor int
eval lc q m cos and print chr ord
for qw y abs ne open tied hex exp
ref y m xor scalar srand print qq
q q xor int eval lc qq y sqrt cos
and print chr ord for qw x printf
each return local x y or print qq
s s and eval q s undef or oct xor
time xor ref print chr int ord lc
foreach qw y hex alarm chdir kill
exec return y s gt sin sort split

lib/Acme/RunDoc.pm  view on Meta::CPAN

package Acme::RunDoc;

use strict;
use autodie;

BEGIN {
	$Acme::RunDoc::AUTHORITY = 'cpan:TOBYINK';
	$Acme::RunDoc::VERSION   = '0.002';
}

# 'undef' is Text::Extract::Word's default filter, and probably the only
# one that makes sense.
use constant FILTER => undef;

use Carp qw//;
use Data::Dumper qw//;
use File::Spec;
use IO::File;
use Text::Extract::Word;
use Module::Runtime qw//;

sub do
{
	my ($class, $file) = _args(@_);
	my $text = Text::Extract::Word->new($file)->get_body(FILTER)
		or CORE::do { $! = 'cannot read file'; return undef };
	return CORE::eval($text);
}

sub require_file
{
	my ($class, $file) = _args(@_);
	my $fh = IO::File->new($file, 'r')
		or Carp::croak("Could not require file $file: $!");
	$class->do($fh) or Carp::croak("Could not require file $file: $@");
}

lib/Acme/RunDoc.pm  view on Meta::CPAN

}

sub import
{
	my ($class, @args) = _args(@_);
	my $caller = scalar caller;
	local $Data::Dumper::Indent = 0;
	while (@args)
	{
		my $module = shift @args;
		my $args   = ref $args[0] ? shift @args : undef;
		my $eval = sprintf(
			"{ package %s; my \@args = %s; Acme::RunDoc->use('%s', \@args); }",
			$caller,
			ref $args eq 'HASH'
				? sprintf('do { my %s; %%$VAR1 }', Data::Dumper::Dumper($args))
				: ref $args
				? sprintf('do { my %s; @$VAR1 }',  Data::Dumper::Dumper($args))
				: '()',
			$module,
			);

lib/Acme/RunDoc.pm  view on Meta::CPAN

   Acme::RunDoc->use($module1, @args1);
   Acme::RunDoc->use($module2, %args2);
   Acme::RunDoc->use($module3);
 }

is:

 use Acme::RunDoc
     $module1  => \@args1,
     $module2  => \%args2,
     $module3  => undef;

(See the sections on C<use>, C<import> and C<require> in L<perlfunc> if any
of that confuses you.)

=head1 SEE ALSO

L<icrosoft::Word>, L<Text::Extract::Word>.

=head1 AUTHOR



( run in 1.078 second using v1.01-cache-2.11-cpan-d80b1682f3f )