FAQ
Folks --

I'm writing a app that uses a DBIx::Class schema in @INC.

I use the same syntax in an app already running (albeit on a different
machine).

my $bill2 = $c->user->bill2->name;

$c->log->debug("shipper is $shipper billto is $bill2");

My $bill2 is defined, as it is printed in the debug. The resultset is
magically available as part of the user login configuration. Somehow,
it works.

However:

my $shippers = [$c->model('TrexDB::DATA')->search({ 'Bill To' =>
$bill2},{})->single];
my $count = scalar @$shippers; # s/b 1 (for testing)

The error is: Can't call method "search" on an undefined value

In my other app, which works, it looks the same. In this app file tree,
the two models sit next to one another in the /Model folder.

Since I have NO IDEA how my Model relates to my Schema, or really, how
it is I can access the schema in my cat app, can someone give me
anything else to check?

Cheers,

--
\ /| | | ~ ~
\/ | |---| `|` ?
ichael | |iggins \^ /
michael.higgins[at]evolone[dot]org

Search Discussions

  • Michael Higgins at Dec 5, 2007 at 9:28 pm

    On Wed, 5 Dec 2007 13:17:46 -0800 Michael Higgins wrote:

    Folks --
    [ snip ]

    Found the unplugged cable, just after the cry for help... of course.

    Isn't that some general principle, you find the error just after
    emailing a whole bunch of people?
    Since I have NO IDEA how my Model relates to my Schema, or really, how
    it is I can access the schema in my cat app, can someone give me
    anything else to check?
    Truly sorry for the static.

    --
    \ /| | | ~ ~
    \/ | |---| `|` ?
    ichael | |iggins \^ /
    michael.higgins[at]evolone[dot]org
  • Jonathan Rockway at Dec 5, 2007 at 9:31 pm

    On Wed, 2007-12-05 at 13:28 -0800, Michael Higgins wrote:
    On Wed, 5 Dec 2007 13:17:46 -0800
    Michael Higgins wrote:
    Folks --
    [ snip ]

    Found the unplugged cable, just after the cry for help... of course.

    Isn't that some general principle, you find the error just after
    emailing a whole bunch of people?
    And what was the issue?

    Regards,
    Jonathan Rockway

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: This is a digitally signed message part
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071205/412b90c6/attachment.pgp
  • Michael Higgins at Dec 5, 2007 at 9:45 pm

    On Wed, 05 Dec 2007 15:31:58 -0600 Jonathan Rockway wrote:

    On Wed, 2007-12-05 at 13:28 -0800, Michael Higgins wrote:
    On Wed, 5 Dec 2007 13:17:46 -0800
    Michael Higgins wrote:
    Folks --
    [ snip ]

    Found the unplugged cable, just after the cry for help... of course.

    Isn't that some general principle, you find the error just after
    emailing a whole bunch of people?
    And what was the issue?
    Basically, the issue is I'm doing two very different jobs at the same
    time. I'd simply forgotten a most basic thing. And I'm not 'really' a
    programmer...

    As I said in the original post, I'm using a dbic schema across
    different apps (cat and no)... my Model instance is the same as the one
    I was using for a working application... the SAME as... the SAME ..!
    D'oh!

    Next time, I'll check to see if I renamed it to match my new app's
    module path. Of course it wasn't initialized, as it 'wasn't found', not
    looking for a path in a folder tree, but for the namespace I registered,
    right?

    I still only barely know what I'm talking about here.

    Live and learn, I suppose. Again, truly sorry for the noise.

    --
    \ /| | | ~ ~
    \/ | |---| `|` ?
    ichael | |iggins \^ /
    michael.higgins[at]evolone[dot]org
  • Aristotle Pagaltzis at Dec 6, 2007 at 12:43 pm

    * Michael Higgins [2007-12-05 22:40]:
    Isn't that some general principle, you find the error just
    after emailing a whole bunch of people?
    Another effective [debugging] technique is to explain your
    code to someone else. This will often cause you to explain
    the bug to yourself. Sometimes it takes no more than a few
    sentences, followed by an embarrassed ?Never mind. I see
    what?s wrong. Sorry to bother you.? This works remarkbly
    well; you can even use non-programmers as listeners. One
    university computer center kept a teddy bear near the help
    desk. Students with mysterious bugs were required to explain
    them to the bear before they could speak to a human
    counselor.

    ?Brian W Kernighan, Rob Pike, ?The Practice of Programming?

    Reportedly, this noticably reduced the load on the understaffed
    centre.

    Regards,
    --
    Aristotle Pagaltzis // <http://plasmasturm.org/>
  • Daniel Hulme at Dec 6, 2007 at 1:03 pm

    On Thu, Dec 06, 2007 at 01:43:32PM +0100, A. Pagaltzis wrote:
    well; you can even use non-programmers as listeners. One
    university computer center kept a teddy bear near the help
    desk. Students with mysterious bugs were required to explain
    them to the bear before they could speak to a human
    counselor.

    —Brian W Kernighan, Rob Pike, “The Practice of Programming�

    Reportedly, this noticably reduced the load on the understaffed
    centre.
    I've heard the same story from elsewhere, even including the name of the
    teddy bear, which I now forget. I keep a stuffed toy atop my monitor for
    the same purpose, and he's really good at spotting mistakes I can't
    find.

    --
    "I think you look like the Mona Lisa. You always seem to be at a window
    admiring the landscape that is actually behind you." Herve Le Tellier
    http://surreal.istic.org/ There's no CVS in “team�.
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: Digital signature
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071206/8d817fd0/attachment.pgp
  • Dave Howorth at Dec 6, 2007 at 1:13 pm

    A. Pagaltzis wrote:
    * Michael Higgins [2007-12-05 22:40]:
    Isn't that some general principle, you find the error just
    after emailing a whole bunch of people?
    Another effective [debugging] technique is to explain your
    code to someone else. This will often cause you to explain
    the bug to yourself. Sometimes it takes no more than a few
    sentences, followed by an embarrassed ?Never mind. I see
    what?s wrong. Sorry to bother you.? This works remarkbly
    well; you can even use non-programmers as listeners. One
    university computer center kept a teddy bear near the help
    desk. Students with mysterious bugs were required to explain
    them to the bear before they could speak to a human
    counselor.

    ?Brian W Kernighan, Rob Pike, ?The Practice of Programming?

    Reportedly, this noticably reduced the load on the understaffed
    centre.
    We had a teddy bear at one place I worked. I can testify first- and
    second-hand that it worked well :)

    Cheers, Dave
  • Jason Kohles at Dec 6, 2007 at 1:56 pm

    On Dec 6, 2007, at 7:43 AM, A. Pagaltzis wrote:

    * Michael Higgins [2007-12-05 22:40]:
    Isn't that some general principle, you find the error just
    after emailing a whole bunch of people?
    Another effective [debugging] technique is to explain your
    code to someone else. This will often cause you to explain
    the bug to yourself. Sometimes it takes no more than a few
    sentences, followed by an embarrassed ?Never mind. I see
    what?s wrong. Sorry to bother you.? This works remarkbly
    well; you can even use non-programmers as listeners. One
    university computer center kept a teddy bear near the help
    desk. Students with mysterious bugs were required to explain
    them to the bear before they could speak to a human
    counselor.

    ?Brian W Kernighan, Rob Pike, ?The Practice of Programming?

    Reportedly, this noticably reduced the load on the understaffed
    centre.
    Also be sure and check out "The Contribution of the Cardboard Cutout
    Dog to Software Reliability and Maintainability" (http://www.sjbaker.org/humor/cardboard_dog.html
    ) Which includes a nice table comparing the various attributes
    (Attention Span, Distraction, Feedback, Cost) for a variety of
    listener types, from engineers to restroom attendants.

    --
    Jason Kohles, RHCA RHCDS RHCE
    email@jasonkohles.com - http://www.jasonkohles.com/
    "A witty saying proves nothing." -- Voltaire
  • Matt S Trout at Dec 15, 2007 at 9:34 pm

    On Wed, Dec 05, 2007 at 01:28:53PM -0800, Michael Higgins wrote:
    On Wed, 5 Dec 2007 13:17:46 -0800
    Michael Higgins wrote:
    Folks --
    [ snip ]

    Found the unplugged cable, just after the cry for help... of course.

    Isn't that some general principle, you find the error just after
    emailing a whole bunch of people?
    Absolutely. The odds of finding it increase exponentionally with the
    number of people you're about to look stupid in front of, too.

    --
    Matt S Trout Catalyst and DBIx::Class consulting and support -
    Technical Director http://www.shadowcat.co.uk/catalyst/
    Shadowcat Systems Ltd. Christmas fun in collectable card game form -
    http://www.shadowcat.co.uk/resources/2007_trading/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 5, '07 at 9:17p
activeDec 15, '07 at 9:34p
posts9
users7
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase