in reply to simplify the code
You don't need all those temporary variables in your loop,
for (@$sur) { my $firstrow = join '<-->', @{$_}{qw/one two four/}; $hash1{$_->{'three'}} .= $hash1{$_->{'three'}} ? '####'.$_->{'four'} : $firstrow; }
Update: The whole loop in a single statement:
No temporaries at all.$hash1{$_->{'three'}} .= $hash1{$_->{'three'}} ? '####' . $_->{'four'} : join( '<-->', @{$_}{qw/one two four/}) for @$sur;
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: simplify the code
by Zed_Lopez (Chaplain) on Oct 09, 2005 at 15:14 UTC | |
Re^2: simplify the code
by Aristotle (Chancellor) on Oct 09, 2005 at 16:41 UTC |