I've come across this many times. When I write the code I now, just as a matter of habit, put a "use" statement in every time that I start using a new type of widget. This will apply to anything that is auto loaded at run time. Testing one of the pp exe files is important as occasionally it will "blow up" when some code is encountered that needs something that is not there.
Since the Op is on Active State, I would consider buying a copy of their dev kit which will contain the PerlApp program. Active State has included some heuristics for common libraries like Tk. PerlApp scans the source code looking for extra things that need to be forced into the .exe. In the Op's case it would have automatically included Tk::Menu into the resulting .exe without him having to put a use statement in the source code.
The disadvantage is that PerlApp will set you back a couple hundred dollars. If you are doing this code for a company, that is the best way to go as this program can do all sorts of other little zoomy touches (include an icon, put in the Microsoft version info in for the file, etc). A few hundred bucks is typically not a problem compared with the time and hassle that this will save the Op.
It is also possible to add command line args that "force" modules into the final .exe, but in my opinion adding a "use" statement in the source code is a far superior solution.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.