in reply to Comparing Two Numbers

Use numify to see what's under the hood:
print version->parse($installed)->numify, '<=>', version->parse($wante +d)->numify, "\n"; # Output: 450.570<=>450.080082

Use 450.57.0 to get what you expect. Comparing dotted versions with different number of elements is tricky.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Comparing Two Numbers
by abs52 (Novice) on Jan 05, 2021 at 10:03 UTC
    Thanks, unfortunately i am comparing driver version, meaning that the numbers needs to correct. As i am using the code to determine if a driver is installed and or should we be installing a new version
      What driver? If it's a Perl module, it got versioning wrong. If it's not, it might use a different versioning rules, which means you can't use Perl's version.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
        Its a perl script that i wrote that runs on boot up for a linux machine. It compares the current running Nvidia driver and check against a list if the current nvidia card should be running a new dirver and if it should be update it Its been working find up to now but this is the first time we have had a driver number with more two decimals

      Hello abs52

      You could check if your two version strings both contain two dots - and append a ".0" if not (as suggested by choroba). And then use the possibly modified versions for comparision, not the original ones.

      HTH, Rata