beckheng has asked for the wisdom of the Perl Monks concerning the following question:
-------configuration file(MyConfigTest.pm)--
-------startup file(mystartup.pl)-------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;
-------my module file(ControllerTest.pm)--#!/usr/bin/perl use lib qw(/path/myprj); use strict; 1;
Regards.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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Please share your advice about my mod_perl program
by ides (Deacon) on Mar 01, 2007 at 15:27 UTC | |
|
Re: Please share your advice about my mod_perl program
by TOD (Friar) on Mar 01, 2007 at 04:30 UTC | |
|
Re: Please share your advice about my mod_perl program
by Joost (Canon) on Mar 01, 2007 at 11:55 UTC | |
|
Re: Please share your advice about my mod_perl program
by perrin (Chancellor) on Mar 01, 2007 at 21:56 UTC | |
|
Re: Please share your advice about my mod_perl program
by jesuashok (Curate) on Mar 01, 2007 at 08:00 UTC |