http://www.perlmonks.org?node_id=1105164


in reply to Re^2: CGI::param called in list context from package
in thread CGI::param called in list context from package

A ha! It looks like CGI::Session is calling ->param in list context with arguments: https://metacpan.org/source/MARKSTOS/CGI-Session-4.48/lib/CGI/Session.pm#L364 The temp solution to this is to set the following in your code: $CGI::LIST_CONTEXT_WARN = 0 An issue needs to be raised against CGI::Session to change it to use multi_param or switch off the warning. The slight irony is that i took over maintenance of CGI from Mark, the current author of CGI::Session...

Replies are listed 'Best First'.
Re^4: CGI::param called in list context from package
by leej (Scribe) on Oct 27, 2014 at 15:27 UTC
      thanks! thats very helpful sir! I would like to add that during my testing i found that even calling save param with
      $session->save_param(scalar $query->param('param_name')) OR even
      $session->save_param($query->param('param_name')
      was causing my module to die without writing to the logs. I had mentioned this in the initial post .
      Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats
        I'm not familiar with CGI::Session, but a quick look at the code shows that the first argument to save_param needs to be the $query object, and you're passing the return value from the call to $query->param, which will be a string, so that's probably why that code doesn't work.
Re^4: CGI::param called in list context from package
by perlron (Pilgrim) on Oct 27, 2014 at 15:38 UTC
    he he.. i just casually chatted online with mark earlier last week, about how i loved his contribution to CGI:Application. I find the api very intuitive (call me lame to still like CGI::Application :D)
    btw.. i am still getting the error in my logs..im not sure why.
    Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats
      You're getting the errors still even setting: $CGI::LIST_CONTEXT_WARN = 0 in your code?
        yes i was.
        had set $CGI::LIST_CONTEXT_WARN = 0;
        as an afterthought i instead set $CGI::Application::LIST_CONTEXT_WARN to 0 and the warning dissapeared Thank you so much for the help!!!
        Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats
Re^4: CGI::param called in list context from package
by Anonymous Monk on Feb 05, 2015 at 13:06 UTC
    this works! $CGI::LIST_CONTEXT_WARN = 0