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.


In reply to Re^7: Trying to use App::Fatpacker by Corion
in thread Trying to use App::Fatpacker by elef

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.