Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Returning single or multiple values?

by bronto (Priest)
on Aug 30, 2004 at 11:10 UTC ( [id://386886]=note: print w/replies, xml ) Need Help??


in reply to Returning single or multiple values?

Why are you needless calling get_value twice? It doesn't come for free! Moreover, why are you calling map that way? Personally, I don't like using map throwing away its result; if I need a cycle I prefer using an explicit foreach, for example.

Anyway, my 2c:

foreach my $entry ($result->all_entries()) { foreach my $attr ($entry->attributes()) { my @a = $entry->get_value($attr); $r->{$entry->dn()}->{$_} = @a > 1? \@a : $a[0] ; } }

Ciao!
--bronto


The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-19 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found