$CGI::DISABLE_UPLOADS = 1; # Disable uploads $CGI::POST_MAX = 512 * 1024; # limit posts to 512K max #### use CGI::Safe; my $q = CGI::Safe->new( DISABLE_UPLOADS => 0 ); #### use CGI::Safe; $CGI::DISABLE_UPLOADS = 0; my $q = CGI::Safe->new; #### my $q = CGI::Safe->new( data => $stuff ); #### ################################ package CGI::Safe; ################################ $VERSION = .1; use strict; use CGI; use vars qw/ @ISA /; @ISA = ( "CGI" ); INIT { # Establish some defaults $CGI::DISABLE_UPLOADS = 1; # Disable uploads $CGI::POST_MAX = 512 * 1024; # limit posts to 512K max } sub new { my ( $self, %args ) = @_; $CGI::DISABLE_UPLOADS = $args{ DISABLE_UPLOADS } if exists $args{ DISABLE_UPLOADS }; $CGI::POST_MAX = $args{ POST_MAX } if exists $args{ POST_MAX }; return ( exists $args{ data } ) ? CGI::new( $self, $args{ data } ) : CGI::new( $self ); }