Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread John Siracusa
On Feb 12, 2008 4:35 PM, Sam Tregar <[EMAIL PROTECTED]> wrote: > Thanks, that should help. Any reason you didn't just bake this into a > default Storbable freeze hook? As you can see from the docs, there are many decisions to be made about what, exactly, gets frozen, and there's no good way to co

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
On Feb 12, 2008 4:18 PM, John Siracusa <[EMAIL PROTECTED]> wrote: > You need to strip() before freezing: > > > http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Helpers.pm#strip > Thanks, that should help. Any reason you didn't just bake this into a default Storbable freeze hook? If

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread John Siracusa
You need to strip() before freezing: http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Helpers.pm#strip Modifying your test: ... package My::Foo; use base 'My::DBObject'; use Rose::DB::Object::Helpers qw(strip); ... my $froze = freeze($foo->strip); -John ---

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
On Feb 12, 2008 3:37 PM, John Siracusa <[EMAIL PROTECTED]> wrote: > On Feb 12, 2008 3:26 PM, Sam Tregar <[EMAIL PROTECTED]> wrote: > > Yes. I can whip up a simple test case if need be. Let me know if that > > would help. > > Yes, that'd help because I can't reproduce it. I added a bit to > t/db

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread John Siracusa
On Feb 12, 2008 3:26 PM, Sam Tregar <[EMAIL PROTECTED]> wrote: > Yes. I can whip up a simple test case if need be. Let me know if that > would help. Yes, that'd help because I can't reproduce it. I added a bit to t/db-object-helpers.t to try: $o = $class->new(id => 1)->load_or_save; e

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
On Feb 12, 2008 2:51 PM, John Siracusa <[EMAIL PROTECTED]> wrote: > On Feb 12, 2008 2:28 PM, Sam Tregar <[EMAIL PROTECTED]> wrote: > > But if I pass the object through Storable: > > > > use Storable qw(freeze thaw); > > my $foo = freeze($object); > > my $obj = thaw($foo); > > $obj-

Re: [RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread John Siracusa
On Feb 12, 2008 2:28 PM, Sam Tregar <[EMAIL PROTECTED]> wrote: > But if I pass the object through Storable: > > use Storable qw(freeze thaw); > my $foo = freeze($object); > my $obj = thaw($foo); > $obj->some_method_that_doesnt_exist("foo"); > > I get the completely nonsensical error

[RDBO] Bizarre Side-Effect of Storable Use

2008-02-12 Thread Sam Tregar
Hello all. I'm serializing some RDBO objects and it's causing some AUTOLOAD confusion when I make a typo. For example, without Storable this code: $object->some_method_that_doesnt_exist("foo"); Produces the expected error: Can't locate object method "some_method_that_doesnt_exist" via pack