Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Comparing Two Numbers

by abs52 (Novice)
on Jan 05, 2021 at 10:03 UTC ( [id://11126359]=note: print w/replies, xml ) Need Help??


in reply to Re: Comparing Two Numbers
in thread Comparing Two Numbers

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

Replies are listed 'Best First'.
Re^3: Comparing Two Numbers
by choroba (Cardinal) on Jan 05, 2021 at 10:07 UTC
    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
Re^3: Comparing Two Numbers
by Ratazong (Monsignor) on Jan 05, 2021 at 11:07 UTC

    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11126359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found