Ken Williams wrote:
Probably the first step is to add a failing test case to t/moduleinfo.t,
would that be fairly easy?
I have to rewrite a custom reporting app for work, so I'm not going to
get to it before tonight. It's fairly straightforward:
1) create a dummy module with the offending two lines;
2) include the path where #1 is located into the @INC paths;
3) call Module::Build::ModuleInfo::new_from_file with the appropriate
parameters in an eval and check to see if any warnings are thrown.
2) the second line is scanned and eval'd *in isolation* and cannot
access the previous line's assignment, so it both fails to "eval" and
also notes that the $VERSION has already been assigned.
My understanding was that the second line shouldn't be scanned at all,
because we already have a $VERSION variable set from the first line.
The problem is (now that I have reviewed the code) that the entire
*file* has to be scanned, in case there are multiple *packages* defined
therein. There isn't any way to short-circuit the test on the second
line that isn't exactly the same situation as today: warn if we see two
$VERSION assignments in the same package.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748