my $this = text_detaint( param('this') ) || 'default text'; or my $this = num_detaint( param('this') ) or output_error( "this", "must be a number" );