Below is the skeleton:

-------configuration file(MyConfigTest.pm)--

package PBB::Packages::MyConfigTest; use strict; @PBB::Packages::MyConfigTest::ISA = qw(Exporter); %PBB::Packages::MyConfigTest::stash = ( "p_type" => "text/html", "p_charset" => "UTF-8", "p_theme" => "gnome-default", "css_files" => ["aa.js", "bb.js"], ); 1;
-------startup file(mystartup.pl)-------
#!/usr/bin/perl use lib qw(/path/myprj); use strict; 1;
-------my module file(ControllerTest.pm)--
package PBB::ControllerTest; use vars qw($q $t); use vars qw(%stash); use Apache2::RequestIO (); use Apache2::Const -compile => ':common'; use CGI qw(); use CGI::Carp qw(fatalsToBrowser); use PBB::Packages::MyConfigTest; use Data::Dumper; use strict; *stash = \%PBB::Packages::MyConfigTest::stash; sub handler{ my $r = shift; $q = new CGI; print $q->header(); $t = {}; @{$t->{stash}}{keys %stash} = values %stash; $t->{stash}->{css_files} = [@{$t->{stash}->{css_files}}, "a.js", " +b.js"]; #other code here return Apache2::Const::OK; } 1;
Regards.

In reply to Please share your advice about my mod_perl program by beckheng

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.