in reply to Re^6: Backdating strict
in thread Backdating strict
I have never refactored code to use strict; because all of my code has been written under strict (command-line one-liners excepted), but when I have had typos in variable names, I have always had great success by simply running the script at a terminal and letting perl point out the errors.
Since this is presumably functioning code, we can expect that there will be no variable-name typos. The simplest option for moving to strict would be to add use strict; and then use vars at top-level, listing the variables already used until all are declared. Narrowing the scopes to lexicals can then be done incrementally, using grep or Emacs' M-x occur to identify where each name is mentioned in the code and understanding of the program to determine where values can be reduced to narrower scopes.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Backdating strict
by LanX (Saint) on Nov 19, 2020 at 00:48 UTC | |
by jcb (Parson) on Nov 19, 2020 at 02:09 UTC | |
by LanX (Saint) on Nov 19, 2020 at 13:13 UTC | |
by jcb (Parson) on Nov 20, 2020 at 02:44 UTC | |
by LanX (Saint) on Nov 20, 2020 at 09:22 UTC | |
| |
by Fletch (Bishop) on Nov 19, 2020 at 14:16 UTC | |
by bliako (Abbot) on Nov 19, 2020 at 19:43 UTC | |
by GrandFather (Saint) on Nov 19, 2020 at 20:18 UTC | |
by LanX (Saint) on Nov 19, 2020 at 22:53 UTC | |
by bliako (Abbot) on Nov 20, 2020 at 08:56 UTC |