Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Coding for maintainability

by jdporter (Paladin)
on Feb 16, 2006 at 18:23 UTC ( [id://530728]=note: print w/replies, xml ) Need Help??


in reply to Coding for maintainability

One thing I would definitely change is the following current practice:

if ( defined $people{$user}{'TC_ENG'} ) { $people{$user}{'TC_ENG'}++; $people{$user}{TOTAL}++; } else { $people{$user}{'TC_ENG'} = 1; $people{$user}{TOTAL}++; }

You should know that incrementing a variable containing an undefined value first treats the undef like a zero, which means it ends up with the value 1. And that doing this to a hash key which doesn't even exist yet makes it exist first. So the above can be replaced by

$people{$user}{'TC_ENG'}++; $people{$user}{TOTAL}++;
We're building the house of the future together.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found