in reply to RFC: DBIx::Library

... my $class = ref($object_or_class) || $object_or_class; ... my $class = ref($proto) || $proto; ...
See "ref($proto) - just say no!". Soon.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: RFC: DBIx::Library
by eric256 (Parson) on Oct 13, 2004 at 19:50 UTC

    Hmm I actualy just grabbed that out of perltoot. Is there a better reference than perltoot for this kind of thing? I'd remebered hearing this before (probably from you). I will definitly change the code as that makes it clearer, to be frank I thought that was needed for inheritance in some way and thats why I kept it in.


    ___________
    Eric Hodges
      perltoot is a cargo-cult promulgator. Much better is Damian Conway's book on OO perl. I forget the name.

      Why would you think it's required for inheritance? Have you studied how method dispatch works in Perl5?

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        A misreading of perltoot is why i thought it was needed. They put two arg form of bless and using ref($class) in the same paragraph saying planing for the future. Definitly my fault there for not reading more accuratly.


        ___________
        Eric Hodges