I was using this code to fetch a CGI parameter:
$page = int(param('page'));
This sometimes results in:
warning: Use of uninitialized value in int
Is this a good solution to resolve this warning, or is better and more succinct code available?
if (defined param('page')) {
$param_page = int(param('page'));
} else {
$param_page = 1;
}
param
function? \$\endgroup\$use CGI qw/:standard/
at the top of my script which imports the param() function. param() gets a value from the query string. \$\endgroup\$