May 21, 2009, 9:17 AM
Post #5 of 5
Re: [Adskiy] How do I find out which system I'm running under?
[In reply to]
'A fair cop', as they say. I did take a look at the Sys::Info module from CPAN, but it didn't do any better (e.g., architecture info was completely unavailable. You can substitute "print "$^O" (dollar-CTRL-O) to for "uname -o" to get the OS. I was unable to find a pure-Perl method for getting the machine architecture. Perhaps others can help with that.
As I noted before, different implementations of uname have their own idiosyncracies. You may just have to suck it up and deal with them in your code. Hint: most versions of uname support the '-a' flag. You can preprocess uname -a to get a general idea of the platform and make syntax adjustments based upon what you see.
(This post was edited by 1arryb on May 21, 2009, 9:19 AM)