Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)

[prev] [thread] [next] [Date index for 2005/05/24]

From: merlyn (Randal L. Schwartz)
Subject: Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
Date: 11:47 on 24 May 2005
>>>>> "Peter" == Peter Speltz <peterspeltz@xxxxx.xxx> writes:

Peter> I tried this. I made a Music::CdTemp class based on C::A.   I first thought
Peter> Perrin and Tony were talking literally about using CDBI's copy method.  However
Peter> that is an object method so that doesn't work.  I tried move .  That is
Peter> deprecated.  So I encapsulated the "copy" functionality into a "create_real"
Peter> object method in the  *Temp class.

I've been successfully using:

  my $obj = My::Foo->construct({ ... });

to make a in-memory object.  Then when I want to "make it real",
it's just

  $obj = $obj->copy; # make it real

This "works".  Am I doing something likely to break in future releases?  It
seemed trivially elegant. :)

        -- 
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: Copying a Class::Accessor class to a CDBI class (CDBI::Plugin::Temp)
merlyn (Randal L. Schwartz) 11:47 on 24 May 2005

Generated at 15:51 on 25 May 2005 by mariachi v0.52