Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

fansipans (7678)

  (email not shown publicly)

Journal of fansipans (7678)

Wednesday May 16, 2007
09:06 AM

Storing Content "Within A Package"

[ #33290 ]
Had a hilarious DUH moment yesterday. I was trying to figure out the best way for my CGI::Application application to bundle in all it's html templates into it's own package so when installed there's nothing other than the perl modules, no other directories / web pages / sites to set up..., everything is in /usr/lib/perl5/5.8.4/MyApp and the Templates are in /usr/lib/perl5/5.8.4/MyApp/Templates

So I'm pondering, and pondering, thinking maybe I can tweak the low-level of Petal's code into treating filenames and perl modules interchangably, and if using a perl module, read in from the __DATA__ section or something...

Then I realize the entire problem is reduced down to one simple variable change to my cgiapp_init:

    default_type => 'Petal',
    include_paths => \@INC

So now CGI::Application looks for my templates, and finds them, as pure html, no __DATA__ jibba jabba, just easy. Huzzah!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.