Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > What is "$^O" on Cygwin?

Reply
Thread Tools

What is "$^O" on Cygwin?

 
 
James E Keenan
Guest
Posts: n/a
 
      09-18-2005
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
 
Reply With Quote
 
 
 
 
Bob Walton
Guest
Posts: n/a
 
      09-18-2005
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
 
Reply With Quote
 
 
 
 
Randy Harris
Guest
Posts: n/a
 
      09-18-2005

"James E Keenan" <(E-Mail Removed)> 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


 
Reply With Quote
 
James E Keenan
Guest
Posts: n/a
 
      09-18-2005
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
 
Reply With Quote
 
Bob Walton
Guest
Posts: n/a
 
      09-18-2005
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
 
Reply With Quote
 
Joe Smith
Guest
Posts: n/a
 
      09-18-2005
Randy Harris wrote:
> "James E Keenan" <(E-Mail Removed)> 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
 
Reply With Quote
 
Sisyphus
Guest
Posts: n/a
 
      09-18-2005

"James E Keenan" <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments