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
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to