modifying %ARGS at the handler.pl level? the CPAN
Louis-David Mitterrand <[email protected]> Tue, 24 Sep 2013 15:53:20 +0200
| Newsgroups | gmane.comp.web.mason.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'd like to make sure all arguments named id_* passed to my app are
postgres-compatible int4 so I developped a small sub:
## sanitize all id_* args
for my $key (keys(%ARGS)) {
$key !~ /^id_/ && next;
for (ref($ARGS{$key}) eq 'ARRAY' ? @{$ARGS{$key}} : $ARGS{$key}) {
$_ = int($_); $_ = 0 if $_ >= 2**31
}
}
Ideally I'd like to run that at the /etc/apache2/handler.pl level so
that I don't have to do it in each web site's autohandler.
How can I access %ARGS from mason's init script?
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk