in reply to Re: Re: Use strict warnings and diagnostics or die
in thread Use strict warnings and diagnostics or die
Strict vars forces you to scope your variables. This is a very good thing. If you don't get why you have probably not read the coping with scoping link and/or worked on debugging code with over 1000 lines and wide use of globals.
Here is a very simple 'vars' typo example that will be caught by strict, will not be caught by warnings and is not 'obvious'. Typos with varnames are the statistically most common cause of software bugs....
use warnings; #use strict; my $recieved = 0; print "Do you get it (y/n)?"; $received = <>; print "Got $recieved" if $received =~ /y/;
Strict and warnings are complementary - they have some overlap but the overlap is imperfect, thus the usefulness of both comes into play.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Use strict warnings and diagnostics or die
by jonadab (Parson) on Feb 03, 2003 at 15:14 UTC | |
by tachyon (Chancellor) on Feb 03, 2003 at 23:55 UTC | |
by jonadab (Parson) on Feb 04, 2003 at 03:49 UTC |