Prev: FAQ 3.6 How do I profile my Perl programs?
Next: FAQ 1.2 Who supports Perl? Who develops it? Why is it free?
From: David Harmon on 21 Feb 2010 12:01 On Mon, 15 Feb 2010 19:33:44 -0800 in comp.lang.perl.misc, merlyn(a)stonehenge.com (Randal L. Schwartz) wrote, >>>>>> "Robin" == Robin <robin1(a)cnsp.com> writes: > >Robin> I know this is a pretty stupid question, maybe, but is it better to >Robin> use strict? I have never gotten a concise answer to this question >Robin> because there reallty isn't any docs on it. > > % perldoc strict [...] > >You have a strange meaning of "isn't any". Care to elaborate? Doesn't exactly say whether "use strict" is better or not, though. If it is generally regarded as better, perhaps "use strict" should be the default with "no strict" to override it if necessary (ever?)
From: Tad McClellan on 21 Feb 2010 12:15 David Harmon <source(a)netcom.com> wrote: >perhaps "use strict" should be > the default That would break many existing programs. That would be not nice at all! Have you seen the BUGS section in "perldoc perl"? (-w (similar to "use warnings") being off by default is a known "bug") -- Tad McClellan email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
From: Tad McClellan on 21 Feb 2010 12:22 David Harmon <source(a)netcom.com> wrote: > On Mon, 15 Feb 2010 19:33:44 -0800 in comp.lang.perl.misc, > merlyn(a)stonehenge.com (Randal L. Schwartz) wrote, >>>>>>> "Robin" == Robin <robin1(a)cnsp.com> writes: >> >>Robin> I know this is a pretty stupid question, maybe, but is it better to >>Robin> use strict? better than what? >>Robin>I have never gotten a concise answer to this question >>Robin> because there reallty isn't any docs on it. >> >> % perldoc strict > [...] >> >>You have a strange meaning of "isn't any". Care to elaborate? > > Doesn't exactly say whether "use strict" is better or not, though. Oh. Then you want the 2nd paragraph of perldoc perlstyle ... You should also always run under C<use strict> or know the reason why not. Since Robin (and, I assume, you) do not know why you would _not_ use strict, you _should_ use strict. :-) -- Tad McClellan email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
From: sln on 22 Feb 2010 10:22 On Sun, 21 Feb 2010 11:22:31 -0600, Tad McClellan <tadmc(a)seesig.invalid> wrote: [snip] >Since Robin (and, I assume, you) do not know why you would _not_ use strict, >you _should_ use strict. :-) Then it might be better to know circumstances one wouldn't use strict in relation to vars, subs, refs, performance, debug, production, bugs, versions, etc ... There has to be a starting point for full understanding. -sln
From: David Harmon on 22 Feb 2010 10:47 On Mon, 22 Feb 2010 07:22:40 -0800 in comp.lang.perl.misc, sln(a)netherlands.com wrote, >On Sun, 21 Feb 2010 11:22:31 -0600, Tad McClellan <tadmc(a)seesig.invalid> wrote: > >[snip] > >>Since Robin (and, I assume, you) do not know why you would _not_ use strict, >>you _should_ use strict. :-) > >Then it might be better to know circumstances one wouldn't use strict in >relation to vars, subs, refs, performance, debug, production, bugs, versions, >etc ... There has to be a starting point for full understanding. Decades of non-perl programming shows me plenty of reason to "use strict" in my own perl code. Tad is right that I really don't see the reason ever not to, but I suppose I'll see it when or if I ever run into it. As for breaking existing code, some of that breakage probably uncovers existing bugs. If it breaks, it's not following perlstyle recommendations anyway.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: FAQ 3.6 How do I profile my Perl programs? Next: FAQ 1.2 Who supports Perl? Who develops it? Why is it free? |