Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: So I'm in a bit of a quandary

by hatter (Pilgrim)
on Jul 09, 2002 at 15:33 UTC ( #180512=note: print w/replies, xml ) Need Help??


in reply to So I'm in a bit of a quandary

I've been in similar code-needs-rewriting situations. I've mostly gone for the step-by-step approach, rather than stop using oldcode one day, and start using newcode instead.
Remember that you can apply strict and other pragmas to a block, you don't have to make the whole thing compliant in one step.
Adding -w or use warnings will often turn up things that the code works despite, rather than because they are there, so be prepared to do some head-scrtching and work out the proper way that function should be working.
Testing - mentioned by several people already, but here just to re-iterate it, test as you go along so you know which change broke everything.
Use wrapper routines when a current subroutine works, but could be called better, so that parameters are localised, pre-processed or passed differently to the new one. This way, new code can use the good function, and old code can use the old one until it's converted. If the old sub is in a library, consider logging each time it's called, so you can figure out which scripts still need converting.

Hopefully after making these ad hoc fixes, one day you'll look at the code and realise that it's just a few hours work to make the last few changes, and in the meantime, the new code you write can take advantage of the new functions and pragma.

the hatter

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://180512]
help
Chatterbox?
[LanX]: as long as he has votes left, the nodelet remains
[LanX]: There is a very simple solution ...
[marinersk]: Correct, so one workaround is to leave one vote.
[marinersk]: But I was looking for a more elegant solution. It appears noone online at this time is aware of one.
[LanX]: go to Nodelet Settings and click "All nodelets off"
[LanX]: SUPER STABLE!!!
[marinersk]: LanX++ LOL Yes, that is another workaround. :-)
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-05-29 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?