develooper Front page | perl.perl5.porters | Postings from April 2003

$VERSION Update and Questions

Thread Next
John Peacock
April 30, 2003 08:17
$VERSION Update and Questions
Message ID:
Just FYI -

I have two patches almost ready to go:

1) Make the $VERSION scalar magical so that this:

	$VERSION = 1.2;

is processed as if the user had typed

	$VERSION = new version 1.2;

The final piece I need is to make this work:

	$VERSION = "1.2_3"; # now a version object
	$VERSION = eval $VERSION; # now just a string :~(

I need to make that eval avoid the stringification so that second line is 
effectively ignored.  Is there some way I can tell if a bit of code is bring run 
inside an eval context, from that random bit of code?  How can I access the OP 
tree from util.c:Perl_vstringify (PL_op seems to be null when I am testing from 

In order to make the compatability module work with earlier Perl's, I 
will have to resort to a source filter, but I want to avoid doing that for 
5.9/5.10 if at all possible.

2) Make Perl's own version be a version object, i.e. PL_patchlevel is created as 
  a version object and $^V and $] are changed to reference that object.  Also 
all tests versus the Perl version (i.e. 'use 5.6') are performed using the 
version object comparisons.  The changes provoke one test failure in t/op/stash.t:

> $ PERL_DESTRUCT_LEVEL=3 ./perl op/stash.t
> 1..1
> # PROG: 
> # %:: = ""
> # Odd number of elements in hash assignment at - line 1.
> # GOT:
> # Odd number of elements in hash assignment at - line 1.
> # Attempt to free unreferenced scalar during global destruction.
> # STATUS: 0
> not ok 1 - fresh_perl - delete $::{STDERR} and print a warning
> # Failed at ./ line 585

which I have been unable to track down and solve.  Can I change that test to 
force it to pass and add a second test which is a TODO so it fails now until 
someone smarter than me can take a look?



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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About