Perl has neat ways to manage namespaces, so you can avoid singletons, esp for procedural code
If you're going for conditional compilation optimize the code use Devel::CheckOS();
use constant WIN32 => !! Devel::CheckOS::os_is('MicrosoftWindows');
This probably doesn't apply to your codebase, but a common mental block is developing your app in a single file when it naturally lends itself to multiple files
Write/develop/test the code normally in seperate files -- don't complicate development by limited thinking about distribution :)
You can combine it into a single file for distribution later, using fatpack/pp/ http://www.cavapackager.com/ or whatever
PAR/pp can pack your script/modules only without including core modules, but you probably think that's too heavy (requires installing/packing PAR)
fatpack is lighter, and you can fatpack YourApp::Linux/YourApp::Windows, and offer linuxapp.pl/windowsapp.pl downloads
or you can use 'cat' with autosplit/autoload like BrowserUk suggests
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||