in reply to Windows Version Detection
But no matter what you do I cant help but saying that some of your regexen worry me a bit. Like for instance you are using dot unescaped. Personally I might try to come up with a regex that pulled apart the various version strings and then looked them up in a hash. Something like
Now you have WinType and WinVer as $1 and $2 respectively. Anyway just thought it needed to be said.local $,="\t"; while (<DATA>) { /Windows\s(\w+)\W+Version\s((?:\d+\.?)+)/ && print $1,$2,"\n"; } #Outputs # 98 4.10.1998 # 2000 5.00.2195 # 95 4.00.1111 # NT 3.51 # NT 4.0 __DATA__ Windows 98 [Version 4.10.1998] Microsoft Windows 2000 [Version 5.00.2195] Microsoft Windows 95. [Version 4.00.1111] Windows NT Version 3.51 Windows NT Version 4.0
:-)
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Windows Version Detection
by jlongino (Parson) on Oct 07, 2001 at 10:04 UTC |