in reply to CGI::Tiny versus undefined parameter/form field
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.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Tiny versus undefined parameter/form field
by Polyglot (Chaplain) on Dec 12, 2022 at 15:16 UTC | |
by pryrt (Abbot) on Dec 12, 2022 at 15:31 UTC | |
by hippo (Archbishop) on Dec 12, 2022 at 16:32 UTC | |
by Polyglot (Chaplain) on Dec 12, 2022 at 16:54 UTC | |
by tybalt89 (Monsignor) on Dec 12, 2022 at 19:09 UTC |