Perldoc Search: "$^O" perl-5.20.1

search official POD


3 PODs, 25 LINEs found.
perlport.pod
214 :     Don't count on a specific environment variable existing in %ENV. Don't count on %ENV entries being case-sensitive, or even case-preserving. Don't try to clear %ENV by saying "%ENV = ();", or, if you really have to, make it conditional on "$^O ne 'VMS'" since in VMS the %ENV table is much more than a per-process key-value string table.
235 :      if ($^O ne 'VMS')
242 :      if ($^O ne 'VMS')
350 :     For those times when it is necessary to have platform-specific code, consider keeping the platform-specific code in one place, making porting to other platforms easier. Use the Config module and the special variable $^O to differentiate platforms, as described in "PLATFORMS".
366 :     Perl is built with a $^O variable that indicates the operating system it was built on. This was implemented to help speed up code that would otherwise have to "use Config" and use the value of $Config{osname}. Of course, to get more detailed information about the system, looking into %Config is certainly recommended.
371 :     Perl works on a bewildering variety of Unix and Unix-like platforms (see e.g. most of the files in the hints/ directory in the source code kit). On most of these systems, the value of $^O (hence $Config{'osname'}, too) is determined either by lowercasing and stripping punctuation from the first field of the string returned by typing "uname -a" (or a similar command) at the shell prompt or by testing the file system for the presence of uniquely named files such as a kernel or header file. Here, for example, are a few of the more popular Unix flavors:
373 :         uname         $^O        $Config{'archname'}
403 :     Because the value of $Config{archname} may depend on the hardware architecture, it can vary more than the value of $^O.
423 :     The $^O variable and the $Config{archname} values for various DOSish perls are as follows:
425 :          OS            $^O      $Config{archname}   ID    Version
450 :         if ($^O eq 'MSWin32') {
562 :     The value of $^O on OpenVMS is "VMS". To determine the architecture that you are running on without resorting to loading all of %Config you can examine the content of the @INC array like so:
574 :             print "I'm not so sure about where $^O is...\n";
605 :     The value of $^O on VOS is "vos". To determine the architecture that you are running on without resorting to loading all of %Config you can examine the content of the @INC array like so:
607 :         if ($^O =~ /vos/) {
654 :     The values of $^O on some of these platforms includes:
656 :         uname         $^O        $Config{'archname'}
723 :     "RISC OS" is the proper name for the operating system, but the value in $^O is "riscos" (because we don't like shouting).
728 :     Some approximate operating system names and their $^O values in the "OTHER" category include:
730 :         OS            $^O        $Config{'archname'}
perlvar.pod
239 :     $^O     The name of the operating system under which this copy of Perl was built, as determined during the configuration process. For examples see "PLATFORMS" in perlport.
243 :             In Windows platforms, $^O is not very helpful: since it is always "MSWin32", it doesn't tell the difference between 95/98/ME/NT/2000/XP/CE/.NET. Use "Win32::GetOSName()" or Win32::GetOSVersion() (see Win32 and perlport) to distinguish between the variants.
354 :                 if ($^O ne 'VMS') {
363 :                 if ($^O ne 'VMS') {
perlvms.pod
79 :     OpenVMS Alpha v7.3-1 and later and all version of OpenVMS I64 support case sensitivity as a process setting (see "SET PROCESS /CASE_LOOKUP=SENSITIVE"). Perl does not currently support case sensitivity on VMS, but it may in the future, so Perl programs should use the "File::Spec->case_tolerant" method to determine the state, and not the $^O variable.
<< Back to Perldoc Search