|
From: Chris W. <ch...@cw...> - 2001-12-11 12:26:37
|
* Victor Piterbarg (ope...@ha...) [011211 06:00]:
> I wrote a method in a handler that inherits from CommonHandler, all
> it does is select a list of objects using fetch_group based on the
> user_id of the current user. As far as I can tell it is written
> almost identical to any other method, however, I get this error when
> I try to do fetch_group(),
>
> Undefined subroutine &nasa::Handler::CreditCard::ARRAY called at
> (eval 446) line 1.
>
> Why would that happen?
> It's probably obvious, but it's also 3am...
Oh -- this is definitely a late-night bug caused by bleary eyes :-)
Change:
my $my_cards = eval($object_class->fetch_group({
where => "user_id = $uid"}));
to:
my $my_cards = eval { $object_class->fetch_group({
where => "user_id = $uid"}) };
(braces not parens for an eval {} block)
Later,
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|