in reply to Re: Object::InsideOut, I don't get it
in thread Object::InsideOut, I don't get it

You are missing sub new just before the beginning '{' in TryOut.pm
Uhm, no, that's nonsense. See the Object::InsideOut docs please.

There _is_ a bug with the "Standard" attribute, but I haven't been able to put my finger on it just yet.

my @data :Field('Accessor' => 'data'); does generate a data accessor.

Adding the Permission=>'private' field results in

OIO::Method error: Can't call private method 'TryOut->data' from class + 'main' Package: main File: object-insideout Line: 19
So that works as expected. I suspect the "Standard" attribute doesn't actually work as documented. Maybe time for a bug report :)
#!/usr/bin/perl use strict; use warnings; package TryOut; use strict; use warnings; { use Object::InsideOut; my @data :Field('Accessor' => 'data', Permission=>'private'); } 1; package main; my $obj = TryOut->new(); $obj->data(42); print $obj->data; __END__

Replies are listed 'Best First'.
Re^3: Object::InsideOut, I don't get it
by xdg (Monsignor) on Mar 05, 2006 at 18:56 UTC
    There _is_ a bug with the "Standard" attribute, but I haven't been able to put my finger on it just yet

    I was surprised to see this bug so dug through the code a bit. The accessor generation is really woolly code, but as best as I can tell, the bug starts around line 1838, where the get accessors are defined -- it looks like the PRIVATE checks are added to code for later evaluation before the actually beginning of the declaration of the accessor -- so the check is called during the eval of the accessor code and thus fails during compilation.

    Please do file this bug -- jdhedden is very responsive about bug fixes.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      Thanks for finding this. I've uploaded a fixed version to CPAN. (I also added tests to the test suite for this.)

      I'd also like to mention that Object::InsideOut has a discussion forum on CPAN.

      Remember: There's always one more bug.