Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

global overhaul: unquote identifiers before =>

Unquote identifiers used as hash keys when occurring before =>.
Rely on the "quotes the operand to the left" feature of =>.
  • Loading branch information...
commit 9eaceae77f44010596cdab941aae1c0bc4a01d8a 1 parent 89ca579
@marschap marschap authored
View
11 lib/Net/LDAP.pm
@@ -80,12 +80,9 @@ sub _err_msg {
}
my %onerror = (
- 'die' => sub {
- require Carp;
- Carp::croak(_err_msg(@_))
- },
- 'warn' => sub { require Carp; Carp::carp(_err_msg(@_)); $_[0] },
- 'undef' => sub { require Carp; Carp::carp(_err_msg(@_)) if $^W; undef },
+ die => sub { require Carp; Carp::croak(_err_msg(@_)) },
+ warn => sub { require Carp; Carp::carp(_err_msg(@_)); $_[0] },
+ undef => sub { require Carp; Carp::carp(_err_msg(@_)) if $^W; undef },
);
sub _error {
@@ -561,7 +558,7 @@ sub add {
}
-my %opcode = ( 'add' => 0, 'delete' => 1, 'replace' => 2, 'increment' => 3);
+my %opcode = ( add => 0, delete => 1, replace => 2, increment => 3 );
sub modify {
my $ldap = shift;
View
10 lib/Net/LDAP/Entry.pm
@@ -21,7 +21,7 @@ sub new {
my $self = shift;
my $type = ref($self) || $self;
- my $entry = bless { 'changetype' => 'add', changes => [] }, $type;
+ my $entry = bless { changetype => 'add', changes => [] }, $type;
@_ and $entry->dn( shift );
@_ and $entry->add( @_ );
@@ -265,20 +265,20 @@ sub update {
if (ref($target) && UNIVERSAL::isa($target, 'Net::LDAP')) {
if ($self->{changetype} eq 'add') {
- $mesg = $target->add($self, 'callback' => $cb, %opt);
+ $mesg = $target->add($self, callback => $cb, %opt);
}
elsif ($self->{changetype} eq 'delete') {
- $mesg = $target->delete($self, 'callback' => $cb, %opt);
+ $mesg = $target->delete($self, callback => $cb, %opt);
}
elsif ($self->{changetype} =~ /modr?dn/o) {
my @args = (newrdn => $self->get_value('newrdn') || undef,
deleteoldrdn => $self->get_value('deleteoldrdn') || undef);
my $newsuperior = $self->get_value('newsuperior');
push(@args, newsuperior => $newsuperior) if $newsuperior;
- $mesg = $target->moddn($self, @args, 'callback' => $cb, %opt);
+ $mesg = $target->moddn($self, @args, callback => $cb, %opt);
}
elsif (@{$self->{changes}}) {
- $mesg = $target->modify($self, 'changes' => $self->{changes}, 'callback' => $cb, %opt);
+ $mesg = $target->modify($self, changes => $self->{changes}, callback => $cb, %opt);
}
else {
require Net::LDAP::Message;
View
6 lib/Net/LDAP/LDIF.pm
@@ -610,18 +610,18 @@ sub handle {
}
my %onerror = (
- 'die' => sub {
+ die => sub {
my $self = shift;
require Carp;
$self->done;
Carp::croak($self->error(@_));
},
- 'warn' => sub {
+ warn => sub {
my $self = shift;
require Carp;
Carp::carp($self->error(@_));
},
- 'undef' => sub {
+ undef => sub {
my $self = shift;
require Carp;
Carp::carp($self->error(@_)) if $^W;
View
4 lib/Net/LDAP/Search.pm
@@ -135,9 +135,9 @@ sub sorted {
$i++;
}
- $v ||= ($a->[1] ||= Net::LDAP::Util::canonical_dn( $a->[0]->dn, "reverse" => 1, separator => "\0"))
+ $v ||= ($a->[1] ||= Net::LDAP::Util::canonical_dn( $a->[0]->dn, reverse => 1, separator => "\0"))
cmp
- ($b->[1] ||= Net::LDAP::Util::canonical_dn( $b->[0]->dn, "reverse" => 1, separator => "\0"));
+ ($b->[1] ||= Net::LDAP::Util::canonical_dn( $b->[0]->dn, reverse => 1, separator => "\0"));
}
map { [ $_ ] } @{$self->{entries}};
}
Please sign in to comment.
Something went wrong with that request. Please try again.