Discussion:
[PATCH] perl -M:Foo -we 1
(too old to reply)
Jan Dubois
2008-02-21 17:56:23 UTC
Permalink
Also, whats the root of the confusion here ?
Useless use of a constant in void context.
The confusion is between -d:DProf and -MDProf, with the former
being mostly equivalent to -MDevel::DProf, except that it also
initializes the debugger.

So maybe the error message should mention: "Did you mean -d:DProf?"

Cheers,
-Jan
Jim Cromie
2008-02-21 19:06:52 UTC
Permalink
Post by Jan Dubois
Also, whats the root of the confusion here ?
Useless use of a constant in void context.
The confusion is between -d:DProf and -MDProf, with the former
being mostly equivalent to -MDevel::DProf, except that it also
initializes the debugger.
So maybe the error message should mention: "Did you mean -d:DProf?"
That would be nice, but it seems like a giant leap of inference.

wrt confusion, I meant perl's, not user's.
-M expects a ~package-name, and normally gives an
excellent user-oriented error message:

$ perl -MDont_Exist -e 1
Can't locate Dont_Exist.pm in @INC (@INC contains: /u

Compared to this, the single-colon warning is distinctly
less instructive. Id agree that the syntax errors that Robin
cited are also not ideal, his 'single-colon' warning is
certainly more specific, and therefore better.

something like this is more friendly, and probably
correct enough even in the corner cases, even w/o
any deeper checks added to the code.

"bad package name (has single colon) after -M or -m option",
perhaps with " see perldoc perlrun" too.

thoughts ?

Loading...