NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Nothing controversial that I see (Score:1)
I don't think you've taken a controversial position at all there, you've hit the nail on the head.
Modules should stay the hell out of your namespace and application except to do the things you've actually asked them to do.
Warnings and logfiles: abso-bloody-lutely.
If you break something, you need to be told about it once, not 5 million times.
If someone else breaks something and doesn't pay attention that they're being told 5 million times, you don't want to find the 5 billion other messages first thing monda
what about catching the warnings? (Score:2)
Re: (Score:1)
Only works per-process.
Most webservers are multiple processes with a limited lifetime (they often get killed after a fixed number of requests).
Then there's the issue that most large sites have a server farm too...
Re: (Score:1)
Re: (Score:1)
Sorry, didn't mean to imply that it doesn't mitigate the problem, it does but it can only mitigate it.
Whether that turns the situation into a manageable one or not would depend on circumstance. :)
Re: (Score:1)
$ perl -Mwarnings -e'$SIG{WARN}=sub{}; my $a; my $b=$a+1;'
No such signal: SIGWARN at -e line 1.
Use of uninitialized value $a in addition (+) at -e line 1.
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
I don't get it (Score:1)
Re: (Score:1)
There's several problems:
One, the module is doing something that isn't its advertised function and _really_ isn't neccessary to implement its core function.
Two, it's changing behaviour of the parent program, this is a bad thing to do even when it _is_ neccessary.
Three, it isn't clear in situations like the Moose one, just when to turn it off or on, consider the following sequence within a single scope:
You enable warnings/strict. You do some code. You turn off warnings/strict. You do some code. You use M
-X (Score:2)
I fully agree. Warnings in production are a no-go. Except very specific and monitored cases maybe.
That's where "perl -X" is useful. Can one enable mod_perl running under -X yet ?
Re: I don't want to be forced into your damned war (Score:1)
use warnings FATAL => 'all';No one has commented on the necessity of empty import lists yet. How about a Critic policy that always requires an explicit import list (with configurable exceptions because the world's not perfect)? I certainly would like that.
Re: (Score:2)
It would be nice, but a little tricky, since you need to exclude pragmas which use the import function to achieve their pragma effects.
It's doable though, and I'd happily enable that rule for Padre if someone wrote it.
Dancer favoritism? (Score:1)
This quote makes me very suspicious about the whole contest, since the Mojolicious folks never even heard a single word about this before.
Nope (Score:1)
I reckon this post was instigated mainly by me. When Adam turned up on the IRC channel after he read from our posts that strict and warnings are on by default, I tried to explain it's on purpose and asked what the problem with it was.
This started a whole discussion when Adam said there's no need for it in production and I countered it saying I do want it in production.
Then the discussion flowed between the rest of the programmers on letting the user be able to change the default warnings on.
This is also som
Re: (Score:1)
Good ol’ Sebastian… :-)
Damn right! (Score:2)
Just like that one text editor...
I often use an idiom that I try to fetch an item, and if successful I want to do something with it; if not successful, the code returns
undef(false). Typically, the code goes something like this:but this text editor complains about it, stating, in a dialog box:
every.
Re: (Score:1)
my $foo == ...in an if statement would be a red flag.where is your bug report? (Score:2)
We could tell you where to turn off the message until we fix the bug. By the way the the feature that is causing that error message is specifically designed to catch mistakes of beginners.
The idea is to catch bugs that can be caused by code like this:
which is valid perl but it is unlikely a beginner would know what it actually does. The example you gave probably should not trigger
Re: (Score:2)
Also I think I have partially fixed that specific bug in 0.59 as it was also causing test failures in Padre where we also use similar constructs here and there.
I think it is still buggy and eventually it should be implemented as a plugin for Perl
Almost damn right! (Score:1)
... and this is why strictures will be the default in Perl. Modules have no business mucking with your namespace, as you say. Perl does.
Note that warnings won't be the default for various reasons.
Just as a point of history (Score:1)
Moose started this whole thing, not any $Adjective::Perl modules. Moose 0.10 (released 05 Jul 2006) turns on strict and warnings for you. Modern::Perl is circa 2009.
I think it was mst who came up with the trick.
Re: (Score:1)
I concur; I saw this in Moose before I wrote M::P.
Awesome rant (Score:1)