in reply to CGI::Tiny versus undefined parameter/form field
Can't call method "param" on an undefined value at /Users/me/PERL/ScriptDir/dev.pl line 1026.
This error message is telling you something very specific: you are invoking a method (called param) on something ($cgi) but the thing you are invoking it on is not a CGI::Tiny object but undef.
So all the rest is irrelevant: $cgi is not the object it is supposed to be, but undef. So you need to look at where $cgi is set, and diagnose what went wrong there (or somewhere in the pathway from there to line 1026).
Once you have fixed that, you can go back to your original line my $bookparam = $cgi->param('book') || ''; and I imagine it should work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Tiny versus undefined parameter/form field
by Polyglot (Chaplain) on Dec 11, 2022 at 21:35 UTC | |
by Bod (Parson) on Dec 11, 2022 at 23:47 UTC |