Click here to get back home

FAQ 8.1 How do I find out which operating system I'm running under?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
FAQ 8.1 How do I find out which operating system I'm running under? PerlFAQ Server 03-28-2008
Posted by PerlFAQ Server on March 28, 2008, 9:03 pm
Please log in for more thread options
This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

8.1: How do I find out which operating system I'm running under?

The $^O variable ($OSNAME if you use English) contains an indication of
the name of the operating system (not its release number) that your perl
binary was built for.



--------------------------------------------------------------------

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.

Posted by jm on March 29, 2008, 8:41 am
Please log in for more thread options


> 8.1: How do I find out which operating system I'm running under?
>
> The $^O variable ($OSNAME if you use English) contains an indication of
> the name of the operating system (not its release number) that your perl
> binary was built for.

Is cygwin an operating system (according to perlport)?

And how can I know what kind of perl I'm running under?

strawberryperl?
activeperl?
cygwinperl?

Posted by Ben Morrow on March 29, 2008, 12:38 pm
Please log in for more thread options

>
> > 8.1: How do I find out which operating system I'm running under?
> >
> > The $^O variable ($OSNAME if you use English) contains an indication of
> > the name of the operating system (not its release number) that your perl
> > binary was built for.
>
> Is cygwin an operating system (according to perlport)?

According to $^O, yes, it is.

> And how can I know what kind of perl I'm running under?
>
> strawberryperl?

Vanilla/Strawberry Perl are no different from a perl built by hand using
MinGW. That's sort-of the point, actually... You can check for
$Config::Config eq 'gcc' if you need to know this, but be aware
ActivePerl fakes its %Config if you have gcc installed.

> activeperl?

ActivePerl defines the builtin Win32::BuildNumber, so you can test for
ActivePerl with defined &Win32::BuildNumber.

> cygwinperl?

$^O eq 'cygwin'

Ben


Similar ThreadsPosted
FAQ 8.1 How do I find out which operating system I'm running under? March 15, 2005, 6:03 pm
FAQ 8.1 How do I find out which operating system I'm running under? June 4, 2005, 11:03 pm
FAQ 8.1 How do I find out which operating system I'm running under? September 23, 2005, 4:03 am
FAQ 8.1 How do I find out which operating system I'm running under? December 18, 2005, 11:03 am
FAQ 8.1 How do I find out which operating system I'm running under? February 13, 2006, 12:03 am
FAQ 8.1 How do I find out which operating system I'm running under? September 5, 2006, 9:03 pm
FAQ 8.1 How do I find out which operating system I'm running under? March 27, 2007, 9:03 am
FAQ 8.1 How do I find out which operating system I'm running under? June 11, 2007, 9:03 pm
FAQ 8.1 How do I find out which operating system I'm running under? August 26, 2007, 9:03 am
FAQ 8.1 How do I find out which operating system I'm running under? November 4, 2007, 2:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap