(yes, I *should* have used Net::LDAP... but I didn't)
Heh, I was about to say as much, then I saw that comment. I initially did the same thing as you: munged the output of ldapsearch. But when I had a spare tuit I rewrote the code to use Net::LDAP. The result is much more satisfying, at two levels.
Firstly, there's no external program to rely on. That's always a big plus in my books. And I also found that the code became simpler, because the munging disappeared.
The main difference in my approach is that I generate the access map every twenty minutes. I then compare the it to the current version and move it over only if there are changes.
There's one bit in the code that puzzles me, the part containing if( $some_condition ) { $_ = 0 } and then below you have if( /some_pattern/ ) {...}. I might be missing something subtle, but it seems to me that this would be better written as next if $some_condition.
But ++ anyway for the code. Having your legitimate recipients known on the perimeter is an excellent way of cutting down on undeliverable crud.
- another intruder with the mooring of the heat of the Perl
|