This may not be completely relevant to your question, but it's related. In most cases, the difference between Windows and Windows is immaterial. Or Linux and Linux. But sometimes it matters.
If you're trying to figure out the difference between Windows ME, Windows 2003, and Windows XP, you have to first use $^O to find out you're on Windows, then load the appropriate Win32 module and find out the version of the OS. Or, if you're trying to figure out the difference between Windows/x86, Windows/x86-64 (AMD64 or EM64T), and Windows/ia64, you need to check %ENV. You're looking for either PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE - which one depends on the machine. I actually use my $proc = $ENV{PROCESSOR_ARCHITEW6432} || $ENV{PROCESSOR_ARCHITECTURE};.
If you're trying to figure out the difference between Linux/x86, Linux/x86-64, Linux/ia64, Linux/ppc, Linux/390, Linux/390x, etc., you need to check the uname - $Config::Config{'archname'} is often good enough.
Again, it usually doesn't matter. It does for me, though, so I've got a routine to explicitly figure out precisely which platform I'm on, and then I load a data file that describes the platform ("unix" vs "win"; "linux" vs "aix" vs "sun" vs "hp" vs "dynix" vs "sco" vs...; "SystemV"; etc.) and then I deal with that data object to find out whether or not to do certain things, and, if I want to do something, how to do it.
| [reply] [d/l] |
| [reply] |