Two answers:
1/ My CGI programs are full of code like:
my $thing = param('thing') || 'default_thing';
2/ It looks to me that your regex already does what you want. It will return the first string of \w characters that it finds.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: Default CGI.pm param() if none provided?
by davorg
in thread Default CGI.pm param() if none provided?
by ybiC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |