Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Error while using stirct.

by tangent (Curate)
on Apr 03, 2012 at 10:52 UTC ( #963212=note: print w/ replies, xml ) Need Help??


in reply to Error while using stirct.

Error while using stirct
Your error isn't to do with using strict (or warnings) - if you turn off strict you will still get an error caused by the two problems highlighted below:
sub LDAPattrsearch { my ($ldap,$searchString,$Attrs,$base) = @_; if (!$base) { $base = "o=hostname.com"; } if (!$Attrs) { $Attrs = [ 'val1','val2','val3','val4']; } } # <---- THIS SHOULDN'T BE HERE AT ALL my $result = $ldap->search ( base => "$base", filter => "$searchString", attrs => "$Attrs" ); } # <---- AND THIS SHOULD GO AT THE END AFTER PRINT print "$result\n";


Comment on Re: Error while using stirct.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2015-07-31 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls