Hi,
I would like to have a very small and simple routine to detect the current used server OS to be ablet to do some simple statistics. The parameter will be passed back as part of the image string in the 'current version' verification.
This is what I have now (from past projects):
#platform (win or unix) detection)
if ($ENV{'SHELL'}){
$platform = ($ENV{'SHELL'} =~ m|^/|) ? 'Unix' : 'Windows'; }
else {
$os1= $^O; $os2= $ENV{'OS'};
$platform = ($os1 eq 'MSWin32' || $os2 =~ /window/i) ? 'Windows' : 'Unix';
}
Do you know any way to detect MAC OS?
I know you could also write a similar thing from the $ENV{'HTTP_USER_AGENT'}, but usually you en up with a long elsif list...
If you have some code snippet which you tested and is reasonably compact, please pass it on.
