$PERLV doesn't contains useful value

Bug #344801 reported by Xavier Brochard
2
Affects Status Importance Assigned to Milestone
Woda
Fix Released
Low
Malcolm Fitzgerald
4.610
Fix Released
Low
Malcolm Fitzgerald

Bug Description

$PERLV contains Perl version, based on this old code:
$PERLV = $] + 0.0; # what Perl are we runing

$] return the perl version in the old format: version + patch level / 1000
with Perl 5.10 it returns perl 5.01 (the following zero are removed)
which is not useful for bug reports

$^V is the modern representation of Perl version. It contains revision number, version, sub-version
this code is useful:
$PERLV = $^V; # what Perl are we runing

Warnings:
I haven't checked when $^V was introduce in Perl.
I haven't checked that sub findMYSubs is still working (perl 4 and perl 5)

Documentation about these variables is in perlvar.

Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :

findMYSubs works with Perl 5.8.8

 just uncomment the call to findMYSubs and run AdmWodaStatus to see it in action

Xavier Brochard (xavier)
description: updated
Revision history for this message
Xavier Brochard (xavier) wrote : Re: [Bug 344801] Re: $PERLV doesn't contains useful value

My description was not complete:
I should have say (said ? doens't remember this point of grammar):
"I haven't checked that sub findMYSubs is still working (perl 4 and perl 5)
with this patch."

Found this in perlvar (it wasn't in the french translation):
"This variable first appeared in perl 5.6.0; earlier versions of perl will see
an undefined value."
http://search.cpan.org/dist/perl/pod/perlvar.pod

the code should be something like
$PERLV = $^V; # what Perl are we runing, returns undefined if Perl > 5.6
$PERLV = $] + 0.0 if (!PERLV); what Perl are we runing if Perl >= 5.6

Le jeudi 19 mars 2009 02:07:36 Malcolm Fitzgerald, vous avez écrit :
> findMYSubs works with Perl 5.8.8
>
> just uncomment the call to findMYSubs and run AdmWodaStatus to see it
> in action

--
Xavier
<email address hidden>
09 54 06 16 26

Revision history for this message
Xavier Brochard (xavier) wrote :

Low importance, because it affects mainly informations needed for reporting bugs. DB admins should knows their perl version. One can also use AdmWodaStatus to see output of perl -v

Changed in woda:
importance: Undecided → Low
Xavier Brochard (xavier)
Changed in woda:
milestone: none → merge-mf-and-xavier
status: New → Confirmed
Revision history for this message
Xavier Brochard (xavier) wrote :

The code should be something like

$PERLV = $^V; # what Perl are we runing, returns undefined if Perl >= 5.6
$PERLV = $] + 0.0 if (!PERLV); # what Perl are we runing if Perl < 5.6

Revision history for this message
Xavier Brochard (xavier) wrote :

Malcolm has already fixed it in sub wbWhoami with:
    $PERLV = $] + 0.0; # what Perl are we running
    $PERLV = $^V if $PERLV >= 5;

Changed in woda:
status: Confirmed → Fix Released
Xavier Brochard (xavier)
Changed in woda:
assignee: nobody → Malcolm Fitzgerald (malcolm-notyourhomework)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.