Acme-RunDoc

 view release on metacpan or  search on metacpan

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


There's a handy shortcut for that too:

  use Acme::RunDoc "Hello::World" => ["greet"];

=head2 C<< do($file) >>

This module provides a class method C<do> which works in an analagous method
to Perl's built-in C<< do $file >> function. In other words, it reads the
contents of the file, and executes it (via C<eval>).

Unlike Perl's built-in, it expects the Perl code to be in Microsoft Word's
"doc" format. Headers, footers, footnotes and annotations are ignored.
"Smart quotes" should be treated as their normal ASCII equivalents.

It may take a file name or an open file handle. (The filehandle needs to be
seekable - see L<IO::Seekable> and L<IO::File>.)

=head2 C<< require_file($file) >>

This class method is analagous to Perl's built-in C<< require $file >>
function. Performs a C<do> on the given filename, but croaks if the file
returns false at the end.

=head2 C<< require($module) >>

This class method is analagous to Perl's built-in C<< require Module >>
function.

Unlike Perl's built-in, it expects Module::Foo to correspond to the file
"Module/Foo.docm".

=head2 C<< use($module) >>

This class method is analagous to Perl's built-in C<< use Module >> function.

Unlike Perl's built-in, this is not automatically executed at compile time.
You'll need to wrap it in a C<< BEGIN { ... } >> block for that to happen.

Unlike Perl's built-in, there is no method for skipping the module's C<import>
method. If you don't want to run C<import>, then just C<require> the module.

=head2 C<< import($module1, \@args1, ...) >>

A handy shortcut for:

 BEGIN {
   require Acme::RunDoc;
   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

Toby Inkster E<lt>tobyink@cpan.orgE<gt>.

=head1 COPYRIGHT AND LICENCE

This software is copyright (c) 2012 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=head1 DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.



( run in 1.304 second using v1.01-cache-2.11-cpan-39bf76dae61 )