in reply to When -w and use strict aren't enough...
All that I have done is stored the subroutine in a variable. Do that with all of your subroutines and all of your typos in subroutines become typos in variable names which strict.pm catches.my $handleNewYear = sub { # do something really useful }; # ... lotsa logic... if (1==$mday && 1==$month) { $handelNewYear->(); }
You may note that I also reversed the order of your == comparisons. The reason for doing that is so that if you type = instead of == some day, Perl will complain because you can't assign to a constant. This is a useful habit in many C-like languages.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: When -w and use strict aren't enough...
by greenFox (Vicar) on Nov 07, 2003 at 15:17 UTC | |
|
Re^2: When -w and use strict aren't enough...
by andyford (Curate) on Jun 15, 2006 at 21:56 UTC | |
by ikegami (Patriarch) on Jun 15, 2006 at 22:24 UTC | |
by tilly (Archbishop) on Jun 17, 2006 at 01:09 UTC |