Hi,

is there a way to test if a controller supports an attribute/method defined 
by 'has'?

Eg;

package MyPackage;

has name => 'John';
has age => '20';

sub some_action {
    my $self = shift;
    my $param = $self->param('param_name);
     
    if( my $ref = eval { $self->can($param) } ){
           # to something with $ref
    }
}

then when I call /some_action/name - this should work
and /some_action/address -  this should NOT work

the above code doesn't do what I want...probably because of AUTOLOAD in 
mojo or something similar

is there a way I could do that check?

Andrei

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to