in reply to Re^4: Test for OS version in Perl
in thread Test for OS version in Perl

If you run your script as perl script.pl instead of script.pl or ./script.pl (as the case may be) then I think you'll always get what you want. For me on Cygwin:
Rob@desktop2 ~/pscrpt $ cat try.pl #!C:/perl58_M/bin/perl print $^X, "\n"; print $^O; Rob@desktop2 ~/pscrpt $ perl try.pl /usr/bin/perl.exe cygwin Rob@desktop2 ~/pscrpt $ ./try.pl C:\perl58_M\bin\perl.exe MSWin32 Rob@desktop2 ~/pscrpt
If you want to take advantage of crappy shortcuts, then be prepared to face the associated inconvenience :-)

Cheers,
Rob
Update: Hmmmm ... after about one minute's reflection, it has oocurred to me that I might have missed the point .... (apologies if that's the case).