Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: simplify the code

by Zed_Lopez (Chaplain)
on Oct 09, 2005 at 15:14 UTC ( [id://498576]=note: print w/replies, xml ) Need Help??


in reply to Re: simplify the code
in thread simplify the code

I wrote basically the same solution, but like having the loop variable (esp. since there's a use of $_ in the map.)

We both changed the conditional in different ways, from ne '' in the original to evaluates true in yours, and to existence in mine.

for my $hashref (@$sur) { if (exists $hash1{$hashref->{three}}) { $hash1{$hashref->{three}} .= "####$hashref->{four}"; } else { $hash1{$hashref->{three}} = join '<-->', map $hashref->{$_}, (qw(o +ne two four)); } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-18 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found