Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I referred to the following table a bunch of times, it ought to be posted around here just in case it disappears from

Also mirrored at

Perl $^O values for various operating systems

Compiled from info in perlport - Writing portable Perl (version 1.39, last modified 11 February 1999, maintained by Chris Nandor

<cite>As of version 5.002, 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 detailed information about the system, looking into %Config is certainly recommended.</cite>

<cite>-- perlport</cite>

Last update: 20.05.1999. Send corrections/additions to

Family Common name $^O $Config{'archname'} notes
Unix AIX aix aix
BSD/OS bsdos i386-bsdos
dgux dgux AViiON-dgux
DYNIX/ptx dynixptx i386-dynixptx
FreeBSD freebsd freebsd-i386
Linux linux i386-linux
HP-UX hpux PA-RISC1.1
IRIX irix irix
openbsd openbsd i386-openbsd
OSF1 dec_osf alpha-dec_osf
reliantunix-n svr4 RM400-svr4
SCO_SV sco_sv i386-sco_sv
SINIX-N svr4 RM400-svr4
sn4609 unicos CRAY_C90-unicos
sn9617 CRAY_J90-unicos
sn6521 unicosmk t3e-unicosmk
SunOS solaris sun4-solaris
SunOS4 sunos   sun4-sunos
Unix?   netbsd  
OS/2 os2
Windows 95 MSWin32 MSWin32-x86 Win32::IsWin95 == 1
Windows 98
Win32::IsWin95 == 1<br> &amp;&amp; hex $build == 1998;

$build = (unpack &quot;A4&quot;x2, sprintf &quot;%08X&quot;, (&amp;Win32::GetOSVersion)[3])[1];
Windows NT Win32::IsWinNT == 1
Mac Mac OS MacOS MacOS_PPC
Mac OS X Server rhapsody    
  OpenVMS 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.
Alpha: grep(/VMS_AXP/, @INC) Vax: grep(/VMS_VAX/, @INC)

See perlport for details.

  VOS 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.
Stratus: grep(/VOS/, @INC) Stratus XA: grep(/860/, @INC) Stratus HP 7100 or 8000: grep(/7100/, @INC) Stratus HP 8000: grep(/8000/, @INC)

See perlport for details.

EBCDIC OS/390 os390
VM/ESA vmesa
  Acorn RISC OS riscos
  Amiga amigaos    
  BeOS beos    
  Plan 9      
  Mach Ten machten    
  MPE/iX mpeix PA-RISC1.1  

Last update: 20.05.1999. Send corrections/additions to

MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.

In reply to Perl $^O values for various operating systems by PodMaster
in thread OS Info by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2022-05-27 19:02 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (97 votes). Check out past polls.