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

Re: [PATCH] version objects final(?) patch

Thread Previous | Thread Next
From:
hv
Date:
February 9, 2003 17:45
Subject:
Re: [PATCH] version objects final(?) patch
Message ID:
200302100147.h1A1lAC15465@crypt.compulink.co.uk
John Peacock <jpeacock@rowman.com> wrote:
:This patch bring the Perl core version objects into sync with the latest CPAN 
:version release (0.27).  Sarathy's objections have hopefully been dealt with; 
:versions that look like numbers are parsed the same whether they are quoted or 
:not.  I still have V-String versions to parse my own way.

Thanks, applied as #18682.

I was just the other day writing some code for work, and I wanted to
write this:
    my %code_tag = (
        v3.4 => 'v3_4',
        v3.5 => 'v3_5',
        "v3.6 alpha" => 'mainline',
    );
.. as a lookup to relate our application version numbers (strings!)
to the CVS branch tags, but couldn't because I knew it would break
with a newer perl. People that have never used nor wanted to care
about vstrings are going to write code like that (and probably
already have), and I think it very important that we avoid changing
the meaning of such code.

If I understand it correctly, the C< v3.4 > in the above is parsed
into a vstring early, but we still cache the original string
somewhere - is that correct? If so, we should then be able to look
for that at the point we do the bareword to string transformation
on seeing the C<< => >>, and restore the string.

Hugo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About