develooper Front page | perl.perl5.porters | Postings from August 2001

Re: vstring guidance needed

Thread Previous | Thread Next
John Peacock
August 20, 2001 08:44
Re: vstring guidance needed
Message ID:
Ronald J Kimball wrote:
> On Mon, Aug 20, 2001 at 10:55:23AM -0400, John Peacock wrote:
> > >
> > > As you see the PV is not a version string.
> >
> > That's just the oversight I am considering fixing.
> It's not an oversight; $] isn't intended to contain a version string!  If
> you change it to hold a version string, you will break code that prints it
> out.  (Oops, you didn't mean to print control characters?  Sorry...)

You're right, I didn't think that one through enough.  I am struggling 
to deal with code like this:

t/comp/use.t:eval sprintf "use %.5f;", $];
t/comp/use.t:eval sprintf "use %.5f;", $] - 0.000001;
t/comp/use.t:eval sprintf("use %.5f;", $] + 1);
t/comp/use.t:eval sprintf "use %.5f;", $] + 0.00001;

since here, $] is clearly a number, but by the time "use" gets to it, 
it has become a v-string.

pp_require() assumes that if you pass it an SV that contains a number
(SvNIOKp), you must be trying to do:

	require 5.6; /* force_version'd into a v-string */

and if not, then you are are doing this:

	require "some_module";

Hence, my problem.  I need to know when a PV contains a v-string and
when it doesn't.  I need a way to test whether a SV contains a 
v-string or not, without relying on PvNIOK.

Any suggestions???


John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

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