What is "$^O" on Cygwin?

Discussion in 'Perl Misc' started by James E Keenan, Sep 18, 2005.

  1. Can anyone running Cygwin tell me what the value for $^O is?

    perl -e 'print "$^O\n";'

    MSWin32? Cygwin? Something else?

    Thanks in advance.

    jimk
     
    James E Keenan, Sep 18, 2005
    #1
    1. Advertising

  2. James E Keenan

    Bob Walton Guest

    James E Keenan wrote:
    > Can anyone running Cygwin tell me what the value for $^O is?
    >
    > perl -e 'print "$^O\n";'
    >
    > MSWin32? Cygwin? Something else?

    ....
    > jimk


    When I try it, I get:

    bob@vektron ~
    $ perl -e 'print $^O'
    cygwin
    bob@vektron ~
    $

    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
     
    Bob Walton, Sep 18, 2005
    #2
    1. Advertising

  3. James E Keenan

    Randy Harris Guest

    "James E Keenan" <> wrote in message
    news:Iu2Xe.5345$iv5.79@trndny03...
    > Can anyone running Cygwin tell me what the value for $^O is?
    >
    > perl -e 'print "$^O\n";'
    >
    > MSWin32? Cygwin? Something else?
    >
    > Thanks in advance.
    >
    > jimk


    $ perl -e 'print "$^O\n";'
    MSWin32
     
    Randy Harris, Sep 18, 2005
    #3
  4. Bob Walton wrote:

    > James E Keenan wrote:
    >
    >> Can anyone running Cygwin tell me what the value for $^O is?
    >>


    >
    > When I try it, I get:
    >
    > bob@vektron ~
    > $ perl -e 'print $^O'
    > cygwin
    > bob@vektron ~
    > $


    and then Randy Harris wrote:

    >
    > $ perl -e 'print "$^O\n";'
    > MSWin32
    >


    Interesting that the results are *not* consistent!

    jimk
     
    James E Keenan, Sep 18, 2005
    #4
  5. James E Keenan

    Bob Walton Guest

    James E Keenan wrote:

    > Bob Walton wrote:
    >
    >> James E Keenan wrote:
    >>
    >>> Can anyone running Cygwin tell me what the value for $^O is?
    >>>

    >
    >>
    >> When I try it, I get:
    >>
    >> bob@vektron ~
    >> $ perl -e 'print $^O'
    >> cygwin
    >> bob@vektron ~
    >> $

    >
    >
    > and then Randy Harris wrote:
    >
    > >
    > > $ perl -e 'print "$^O\n";'
    > > MSWin32
    > >

    >
    > Interesting that the results are *not* consistent!
    >
    > jimk


    I can get that result also, if I execute ActiveState Perl built
    for Windoze under Cygwin:

    bob@vektron ~
    $ /cygdrive/c/perl/bin/perl.exe -e 'print $^O'
    MSWin32
    bob@vektron ~
    $

    I was executing Perl built under Cygwin when I got the "cygwin"
    result. HTH.
    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
     
    Bob Walton, Sep 18, 2005
    #5
  6. James E Keenan

    Joe Smith Guest

    Randy Harris wrote:
    > "James E Keenan" <> wrote in message
    > news:Iu2Xe.5345$iv5.79@trndny03...
    >
    >>Can anyone running Cygwin tell me what the value for $^O is?
    >>
    >> perl -e 'print "$^O\n";'
    >>
    >>MSWin32? Cygwin? Something else?
    >>
    >>Thanks in advance.
    >>
    >>jimk

    >
    >
    > $ perl -e 'print "$^O\n";'
    > MSWin32


    That's the wrong perl. You need to readjust your $PATH.

    bash-2.05b$ /usr/bin/perl -le 'print $^O'
    cygwin
    bash-2.05b$ /cygdrive/c/perl/bin/perl -le 'print $^O'
    MSWin32
    bash-2.05b$

    -Joe
     
    Joe Smith, Sep 18, 2005
    #6
  7. James E Keenan

    Sisyphus Guest

    "James E Keenan" <> wrote in message
    news:Iu2Xe.5345$iv5.79@trndny03...
    > Can anyone running Cygwin tell me what the value for $^O is?
    >
    > perl -e 'print "$^O\n";'
    >
    > MSWin32? Cygwin? Something else?
    >


    You will find that '/mswin/i' will always match $^O on Microsoft Windows and
    *never* match $^O on Cygwin - and that '/cygwin/i' will always match $^O on
    Cygwin and *never* match $^O on Microsoft Windows. (But that answers a
    different question :)

    Cheers,
    Rob
     
    Sisyphus, Sep 18, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pini

    ghdl on wondows (cygwin)

    pini, Oct 25, 2004, in forum: VHDL
    Replies:
    0
    Views:
    702
  2. Replies:
    0
    Views:
    513
  3. Replies:
    0
    Views:
    458
  4. WELCOME to

    , Sep 3, 2003, in forum: Python
    Replies:
    1
    Views:
    536
    Robin Becker
    Sep 5, 2003
  5. Replies:
    0
    Views:
    422
Loading...

Share This Page