in reply to Backward compatibility: $^O in perl 4
Looking throught the Perl 4 documentation and library, I can't find anything that could help you. Using uname is indeed the simplest solution, but be careful that very few options of uname are common (or have the same meaning) upon the various Unix systems. I remember facing some troubles on HPUX and IRIX.
Probably a good start is to look at how autoconf or the Configure script from Perl do their system detection.