Skip to content

Instantly share code, notes, and snippets.

@cfedde
Created March 5, 2013 16:51
Show Gist options
  • Save cfedde/5091772 to your computer and use it in GitHub Desktop.
Save cfedde/5091772 to your computer and use it in GitHub Desktop.
an example
package BCV::LDAP::User;
use Moose;
use namespace::autoclean;
has entry => (
is => 'ro',
isa => 'Net::LDAP::Entry',
);
our $AUTOLOAD;
sub attributes {
my $s = shift;
$s->entry->attributes();
}
sub AUTOLOAD {
my $s = shift;
my $attr = $AUTOLOAD;
$attr =~ s/.*:://;
return $s->entry->get_value($attr);
}
__PACKAGE__->meta->make_immutable;
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment