Next | Program Repair Shop | 29 |
my %stationInfo = shift; my ($callsign, $timestamp, $position, $status) = @stationInfo{qw( Callsign LastHeard Position Status)};
But actually, in this case we can do better
This code is immediately followed by:
print $output "Callsign: $callsign\n"; print $output "Timestamp: $timestamp\n"; print $output "Position (Latitude & Longitude), Region: $position\n"; print $output "Status: $status\n";
Use immediately follows assignment
print $output "Callsign: $stationInfo{Callsign}\n"; print $output "Timestamp: $stationInfo{LastHeard}\n"; print $output "Position (Latitude & Longitude), Region: $stationInfo{Position\n"; print $output "Status: $stationInfo{Status}\n";
Then we can lose the four extraneous variables and four lines of
codeNext | Copyright © 2006 M. J. Dominus |