in reply to Re: Re: Some suggestions on coding style - a chance to critique
in thread Some suggestions on coding style - a chance to critique
Dump the "&" in front of subroutine calls.
- Using & disables a function's prototype.
- If you don't pass any parameters to a function, but call it using &, it will receive your current @_ as its parameters. This can lead to very hard to spot errors.
Is it just that I should use the hash in my code as opposed to assigning the hash values to a variable and then using the variable instead?
Indeed. Why assign to a hash first when you're going to put it into a variable afterwards? Using a hash also is usually cleaner, since it provides an own little name space for the variables in question; it keeps together what belongs together, and keeps them from littering the global namespace.
What exactly does the $|=1 do?
It disables buffering for the currently selected filehandle (which would usually be STDOUT). See perlvar.
Makeshifts last the longest.