while ( my ( $key, $value ) = each %pwd_reset_errors ) {
if ( $key =~ m/^$error.*/ ) {
...
}
This iterates thru the hash list
%pwd_reset_errors right? So whats wrong with doing it like this above
IF the key matches the error code? Why would you want to match it the other way around? I am just asking for better understanding :)
To me its like you wanting to do soemthing of this nature:
my $one = 1;
if ($one =~ 1){
...
}elsif(1 =~ $one){
...
}
Why would it matter if $one eq 1 or 1 eq $one, they were both the same thing. But like i said i am just asking for better understanding.
EDIT: I just realized that Net::LDAP error is quite different than your keys in the hash. You could split the error code from Net::LDAP so it just contains everything before ':' and then match either way.
EDIT 2: I had to much coffee. ;l