in reply to Re: Moose and AUTOLOAD
in thread Moose and AUTOLOAD

nice :) thanx for the idea

;( wont help cause I hold the current row of data in $rs->{row} ... so it has to be $rs->{row}{field_name}

Replies are listed 'Best First'.
Re^3: Moose and AUTOLOAD
by Anonymous Monk on Nov 04, 2010 at 16:18 UTC
    my $method = $$rs{row}{field_name}; my $rv = $object->$method();

    or

    my ($rv) = map { $object->$_() } $$rs{row}{field_name};

    or

    use List::Util qw( first ); # core since Perl 5.7.3 my $rv = first { $object->$_() } $$rs{row}{field_name};

    or

    $object->$_() for $$rs{row}{field_name};, if you don't need to save its return value.