[Catalyst] Problem with BindLex panicking for nothing...

Kieren Diment diment at gmail.com
Tue Aug 5 13:06:09 BST 2008


Yeah, don't use BindLex as it failes in interesting, exotic and  
unpredictable ways (like the one you describe below)

The latest version has a great big deprecation notice.  Sorry the  
book is out of date on this.


On 5 Aug 2008, at 21:56, kakimoto at tpg.com.au wrote:

> Hi, guys,
>
> The URL used was
> "http://www.select-a-bank-loan.com:3000/loanss/list?id=338".
>
> For some silly reason, a call with a parameter of "id" causes this  
> issue of
> "[error] Caught exception in myApp::Controller::Loans->list "Exception
> Caught->panic: Can't find ARRAY(0x8a068fc) in the the caller's lexical
> pad at /usr/local/share/perl/5.8.8/Catalyst/Controller/BindLex.pm  
> line 103."
>
>  I see no reason why BindLex should ever panic or be called in this
> instance.. I am just dealing with a freaking param('id') element.
>
>
> [1] Here's the bit of code that I have...
> ========================
>
>
>
> sub list :Local {
>     my ($self, $c)  = @_;
>
>     # make sure we set the user object to the stash.
>     ## $c->flash->{'user'} = $c->user;
>     my $user: Stashed = $c->user;
>
>     my $view_specific_loan_id = $c->request->param('id');
>     $c->log->debug("...we now have a ID of " .  
> $view_specific_loan_id);
>
>     if (defined($view_specific_loan_id) and $view_specific_loan_id =~
> m/^\d+$/)
>     {
>         my @loans : Stashed = $c->model('myAppDB::Listing')->search(
>             agent_id => $c->user(),
>             {
>                 'order_by' => 'id DESC',
>             }
>         );
>     }
>     else
>     {
>         my @loans : Stashed = $c->model('myAppDB::Listing')->search(
>             agent_id => $c->user(),
>             {
>                 'order_by' => 'id DESC',
>             }
>         );
>     }
>
>     $c->stash->{'template'} = 'loans/list.tt2';
> }
>
>
>
> [2] Here is what the output looks like
> ========================
>
> [debug] Query Parameters are:
> .------------------------------------- 
> +--------------------------------------.
> | Parameter                           | Value
>      |
> +------------------------------------- 
> +--------------------------------------+
> | id                                  | 338
>      |
> '------------------------------------- 
> +--------------------------------------'
> [debug] "GET" request for "loans/list" from "......"
> [debug] Found sessionid "ecd9d0422eef2160feeac8eac0c499666b684b77"  
> in cookie
> [debug] Path is "loans/list"
> [debug] Restored session "ecd9d0422eef2160feeac8eac0c499666b684b77"
> [debug] ...we now have a ID of 338
> [error] Caught exception in gozila::Controller::Listings->list
> "Exception Caught->panic: Can't find ARRAY(0x8a068fc) in the the
> caller's lexical pad at
> /usr/local/share/perl/5.8.8/Catalyst/Controller/BindLex.pm line 103."
> [info] Request took 0.770688s (1.298/s)
>
>
>
>
> Please help....
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/ 
> catalyst at lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list