in reply to Re^6: Trying to use App::Fatpacker
in thread Trying to use App::Fatpacker
No. You can wrap a whole package in a block:
{ package HTML::Strip; ... rest of HTML/Strip.pm goes here }
The two things you need to look out for is __END__ blocks or __DATA__ blocks in the modules, and "unclosed" POD sections. You need to close the POD sections and remove everything from __END__ or __DATA__ onwards because Perl stops reading the file at these locations too.
So if you have an example file HTML/Strip.pm
package HTML::Strip; sub pole_slide { ... }; 1; __END__ =head1 NAME HTML::Strip =cut
... you'd include the following in your main program:
package HTML::Strip; sub pole_slide { ... }; 1; package main; # use HTML::Strip; BEGIN { HTML::Strip->import() }; # rest of your main program goes here
This is a slightly different approach than what App::Fatpacker uses, and it requires a bit more human judgement, but it involves much less Perl internals and you'll learn a bit about how packages and modules interact.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Trying to use App::Fatpacker
by elef (Friar) on Nov 03, 2010 at 22:19 UTC | |
by Anonymous Monk on Nov 04, 2010 at 13:25 UTC | |
by elef (Friar) on Nov 04, 2010 at 15:47 UTC |