Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: So I'm in a bit of a quandary by hatter
in thread So I'm in a bit of a quandary by vek

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [Discipulus]: yees.. masonry, shaving of the ceiling (dunno if shaving is the right term..) 20hours in the weekend.. so veery good ;=)
    [LanX]: yes I worked ...
    [LanX]: ... and hope to get a free work day in compensation. :)
    choroba went to a museum with the older children. The exhibition was called "American Indians".
    [Discipulus]: this and...
    [Discipulus]: shaving the ceil

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (9)
    As of 2018-02-19 10:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      When it is dark outside I am happiest to see ...














      Results (261 votes). Check out past polls.

      Notices?