Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Unusual (and pointless?) idiom in old code

by TomDLux (Vicar)
on Sep 22, 2011 at 17:24 UTC ( #927421=note: print w/replies, xml ) Need Help??


in reply to Unusual (and pointless?) idiom in old code

Is this in a loop, eliminating values from the previous iteration? If not, you don't need to assign anything at all. If it IS in a loop, try moving the declaration into the loop, so that once again you don't need to initialize, because limited scope causes the variable to be created, new and empty, once each time around.

I have similar problems, with code written 12 years ago by interns borrowed from the mainframe department and not supervised or peer-reviewed.

As Occam said: Entia non sunt multiplicanda praeter necessitatem.

  • Comment on Re: Unusual (and pointless?) idiom in old code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927421]
help
Chatterbox?
[Lady_Aleena]: robby_dobby, at least you aren't driving. I seem to always be driving somewhere in my dreams and end up at a weird house.
[robby_dobby]: LA: That's there. But this is work and it's the same thing as falling asleep driving :-)
[Lady_Aleena]: I love the dream where I was at a huge house and decided to go swimming in the pool, but then the tour group showed up.
choroba fell asleep while driving half a year ago
[choroba]: fortunately, only the traffic sign and the car were damaged
[Discipulus]: fall asleep? coffee time!
Discipulus when in motorbike it is impossible to fall asleep.. another advantage

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-05-29 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?