package GWP::Safe; $VERSION='1.0'; require 5.000; require Exporter; use lib "modules"; use GWP::Prefs; use CGI (); @ISA = qw(Exporter); @EXPORT = ( 'param' ); use strict; # this is to fix tainting sub param($) { my ($string) = @_; if (defined wantarray and wantarray == 1) { my @retval = CGI::param($string); for(my $i = 0; $i <= $#retval; $i++) { $retval[$i] =~ /(.*)/; $retval[$i] = $1; } return @retval; } else { my $retval; $retval = CGI::param($string); # this is always undef! if ($retval =~ /(.*)/) { $retval = $1; } else { error ("Bad data in $retval"); } return $retval; } }