I've had bugs like that. I don't know what would take more time, debugging such bugs or initializing every variable. The former is rare. The latter would have to be done all the time.
Luckily, I have VarStructor 1.0 to list all my variables so I could see if I made such a typo. And there is no module that does a better job listing the variables within a script. Diotalevi thought he had a contender, then demerphq thought he had one. Bugs were brought to their attention shortly thereafter. If the only contribution VarStructor 1.0 has made to the Perl community is to highlight the bugs in competing modules, and get them repaired, it was worth it. And now that the bugs are fixed in the competing modules, VarStructor 1.0 STILL kicks their ass.
I deleted the VarStructor 1.0 code from Perlmonks a few days ago, so I guess you all have one more reason to use strict than I do. This isn't a local variable issue anyway, incase nobody noticed.
You said "People use local variables in subs because they like to turn them into modules that get used in other programs..."
I'm not such a people.
In reply to Re^5: Global variable vs passing variable from sub to sub
by Wassercrats
in thread Global variable vs passing variable from sub to sub
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |