i was fooling around today and finally got some great help from Shawn Moore and Chris Prather in #moose.
I've started fooling around with a way to have accessors for an HTML::Tree .... nowhere near CPAN publish level yet <http://code.google.com/p/cpan-modules/source/browse/tmp/try6.pl> package Get4; use LookDown; use HTML::TreeBuilder; has file => ( is => 'rw', default => 'file.html' ); has tree => ( is => 'rw', lazy_build => 1 ); sub _build_tree { my ($self) = @_; HTML::TreeBuilder->new_from_file( $self->file ); } has_ld name => [ id => 'name' ] ; has_ld w => [ id => qr/w.lc.me/ ] ; 1; package main; my $o = Get4->new; warn $o->w; 1; <http://code.google.com/p/cpan-modules/source/browse/tmp/LookDown.pm> package LookDown; use Moose (); use Moose::Exporter; Moose::Exporter->setup_import_methods ( with_caller => [ 'has_ld' ], also => 'Moose', ); use Data::Dumper; sub has_ld { my ($caller, $name, $look_down) = @_; warn Dumper($caller, $name, $look_down); Class::MOP::class_of($caller)->add_attribute($name, is => 'ro', lazy => 1, default => sub { warn `date` ; $_[0]->tree->look_down(@$look_down); } ); } 1;
------------------------------------------------------------------------------
_______________________________________________ seamstress-discuss mailing list seamstress-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/seamstress-discuss