It's pretty straightforward to construct an SSCCE showing this working just fine both with the specified parameter and without:
$ cat foo.cgi #!/usr/bin/env perl use strict; use warnings; use CGI::Tiny; cgi { my $cgi = $_; my $bookparam = $cgi->param('book') || ''; $cgi->render (text => "bookparam is $bookparam\n"); } $ (export QUERY_STRING='book=bar'; ./foo.cgi) Date: Mon, 12 Dec 2022 13:57:29 GMT Content-Type: text/plain;charset=UTF-8 Content-Length: 17 bookparam is bar $ ./foo.cgi Date: Mon, 12 Dec 2022 14:01:26 GMT Content-Type: text/plain;charset=UTF-8 Content-Length: 14 bookparam is $
As others have suggested, it seems that your $cgi is undefined. The error is in the code you haven't shown us.
🦛
In reply to Re: CGI::Tiny versus undefined parameter/form field
by hippo
in thread CGI::Tiny versus undefined parameter/form field
by Polyglot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |