daniel808 has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/perl.exe -w use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); &main(); sub main{ trimParameters($CGI::Q); print header(), p('Done'); } sub trimParameters{ my $q = shift; foreach ( $q->param() ){ ##### if ($q->param($_)) { $q->param($_,trim($q->param($_))); } } } sub trim{ my ($v) = @_; $v =~ s/^\s*(.*?)\s*$/$1/s; return $v; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Understanding $CGI::Q
by bobn (Chaplain) on Jul 15, 2003 at 23:23 UTC | |
by daniel808 (Initiate) on Jul 15, 2003 at 23:44 UTC | |
|
Re: Understanding $CGI::Q
by the pusher robot (Monk) on Jul 15, 2003 at 23:15 UTC | |
by Anonymous Monk on Jul 15, 2003 at 23:34 UTC | |
by daniel808 (Initiate) on Jul 15, 2003 at 23:36 UTC |