[Catalyst] Problem with BindLex panicking for nothing...
John Romkey
romkey at apocalypse.org
Tue Aug 5 13:08:06 BST 2008
On Aug 5, 2008, at 7:56 AM, 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've seen this kind of problem with BindLex when I accidentally had a
'my $var' twice
for the same variable. But that's not a problem in your code.
> 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',
> }
> );
I would try moving 'my @loans' out of the if/else: declare @loans
outside of the if/else and just assign to it inside them.
I think that these kinds of issues are part of the reason that we're
advised not to use BindLex...
- john romkey
http://www.romkey.com/
More information about the Catalyst
mailing list