Re: Darwin darwin or darwin6.0

2002-11-24 Thread Chris Nandor
In article ,
 [EMAIL PROTECTED] (Doug McNutt) wrote:

> We are getting somewhere here. I think I have to add code to support MacPerl 
> and perl running under Windoze or DOS. Perhaps Parrot/Perl6 will fix it all 
> up.

There's nothing really to fix up.  It is what it is; $^O values are 
arbitrary.  There's a default way of getting it, but no standard to abide 
by.  Under perl, you just need to know to use $^O, and what the values are 
(most of which are listed in perlport.pod).

What you basically need to do is figure out how to identify a particular OS 
in whatever environment you are in.  Under most Unixes, you can use uname.


> Over on the MacPerl list the suggestion is to use Gestalt but I'll bet one 
> can't do that until after the OS is determined somehow.

I don't recall that.  Someone asked how to get the OS version, which under 
Mac OS can be done with Gestalt.

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/



Re: Darwin darwin or darwin6.0

2002-11-18 Thread drieux

On Sunday, Nov 17, 2002, at 20:22 US/Pacific, Peter N Lewis wrote:


At 11:39 -0800 16/11/02, drieux wrote:


[jeeves: 1:] perl -MConfig -e 'print "$Config{osname} \n"; '



As for how this gets set - it gets set when your version of perl
is built for that specific OS.


which in turn is stored in Config.pm, typically somewhere like 
/Library/Perl/darwin/Config.pm or System/Library/Perl/darwin/Config.pm

this can be handy if you need to "correct" any settings (such as 
library or include paths).

Randell has already done the PANIC MOMENT about not
dwiddling the Config.pm file directly.

Remember that the token $^O - the 'osname' that this version
of perl is built with can be directly accessed IN perl itself
without the need for the Config.pm that is dynamically built
when you build perl itself... so dithering the Config.pm will
have the grotesque ugly of 'psycho-version-skew' with the
Config.pm handing out one set of values and perl itself living
in a different world.

YOU DO NOT WANT THAT EXPERIENCE. { unless you are way bored... 8-)}

there are three perfectly SANE ways to manage 'correct library settings'

	a) use lib "$ENV{HOME}/lib/perl";
	b) PERL5LIB - the environmental variable
	c) rebuild your perl code itself to include the appropriate additional 
paths

the later seems 'odd' to some - but if you are doing things like
wanting to allow the vendor to supply their updates to perl stuff
in their 'happy place' - yet want to be 'old fashion' about always
installing the CPAN stuff, et al, in /usr/local, then you wind up
opting in for things like:

{ from the perl -V output }
Characteristics of this binary (from libperl):
  Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
  Built under solaris
  Compiled at Aug 25 2002 12:19:33
  @INC:
/usr/local/lib/perl5/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/vendor_perl/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/vendor_perl/5.6.1
/usr/local/lib/perl5/vendor_perl
/usr/perl5/5.6.1/lib/sun4-solaris-64int
/usr/perl5/5.6.1/lib
/usr/perl5/site_perl/5.6.1/sun4-solaris-64int
/usr/perl5/site_perl/5.6.1
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
/usr/perl5/vendor_perl/5.6.1
/usr/perl5/vendor_perl
.

because you needed to rebuild it anyway to throw the 'USE_LARGE_FILES'
flag any way unlike say the darwin version that apple provided that
just did the Right Thing the first time anyway...

The above pattern also allows one to differenciate in their Makefile.PL
whether they can detect the sitelib is the only option or if set, can
we install into installvendorlib . as well as where to put the
architecture dependent components, et al



ciao
drieux

---



Re: Darwin darwin or darwin6.0

2002-11-18 Thread Randal L. Schwartz
> "Peter" == Peter N Lewis <[EMAIL PROTECTED]> writes:

Peter> which in turn is stored in Config.pm, typically somewhere like
Peter> /Library/Perl/darwin/Config.pm or System/Library/Perl/darwin/Config.pm

Peter> this can be handy if you need to "correct" any settings (such as
Peter> library or include paths).

Danger danger danger!  You can't just *edit* that file, since those
are *reflections* of how things were noted at compile time.  Many
things have those values *locked in*.  The purpose of Config.pm is
just to give you "after-market" observations of the data.

DO NOT EDIT Config.pm

Rebuild Perl instead.  It's Free.  It's Easy.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Darwin darwin or darwin6.0

2002-11-17 Thread Peter N Lewis
At 11:39 -0800 16/11/02, drieux wrote:


[jeeves: 1:] perl -MConfig -e 'print "$Config{osname} \n"; '



As for how this gets set - it gets set when your version of perl
is built for that specific OS.


which in turn is stored in Config.pm, typically somewhere like 
/Library/Perl/darwin/Config.pm or System/Library/Perl/darwin/Config.pm

this can be handy if you need to "correct" any settings (such as 
library or include paths).

Enjoy,
   Peter.

--
  


Re: Darwin darwin or darwin6.0

2002-11-16 Thread Doug McNutt
We are getting somewhere here. I think I have to add code to support MacPerl and perl 
running under Windoze or DOS. Perhaps Parrot/Perl6 will fix it all up.

Using MPW on MacOS 9.1
perl -v
This is perl, version 5.004
perl -e 'print `uname`;'
### ToolServer - Command "uname" was not found. (Not surprising.)
perl -e 'print $^O;'
MacOS

Over on the MacPerl list the suggestion is to use Gestalt but I'll bet one can't do 
that until after the OS is determined somehow.

I donno about uname on a M$ box but $^O returns:
"MSWin32"   or   "dos"
depending on how the perl script is executed, booting into real DOS or emulated DOS 
under Windoze. Note the non-use of lowercase in both MacPerl and Windoze versions. I'm 
pretty sure it's Active Perl but I really don't know what's in use at the other end.

At 13:45 -0500 11/16/02, William H. Magill wrote:
>opsys=`uname -a | cut -d" " -f1`
>print " opsys = $opsys"
>case $opsys in
>OSF1) ?? DPM  Is that for Open Software Foundation - Linux?
>SunOS)   ?? DPM  My ISP returns "solaris" for $^O in perl 5.00x but 
>"SunOS" using uname.
>HP-UX)
>AIX)
>Darwin|darwin)
>esac


-- 

--> In Christianity, man can have only one wife. This is known as monotony. <--



Re: Darwin darwin or darwin6.0

2002-11-16 Thread drieux

On Saturday, Nov 16, 2002, at 10:45 US/Pacific, William H. Magill wrote:

On Friday, November 15, 2002, at 11:34 AM, Doug McNutt wrote:


What is the "official" name of the operating system under MacOS neXt?

Where does perl get it?

[..]


I don't know why perl downcases it.


for the same reason that it 'downcases' the other OS's

[jeeves: 1:] perl -MConfig -e 'print "$Config{osname} \n"; '
darwin
[jeeves: 2:] uname -a
Darwin jeeves.wetware.com 6.2 Darwin Kernel Version 6.2: Tue Nov  5 
22:00:03 PST 2002; root:xnu/xnu-344.12.2.obj~1/RELEASE_PPC  Power 
Macintosh powerpc
[jeeves: 3:]
vladimir: 51:] perl -MConfig -e 'print "$Config{osname} \n"; '
solaris
vladimir: 52:] uname -a
SunOS vladimir 5.9 Generic_113184-01 sun4u sparc 
SUNW,UltraSPARC-IIi-Engine
vladimir: 53:]
xanana: 51:]  perl -MConfig -e 'print "$Config{osname} \n"; '
linux
xanana: 52:] uname -a
Linux xanana 2.4.18-10smp #1 SMP Wed Aug 7 11:17:48 EDT 2002 i686 
unknown
xanana: 53:]
xlotl: 51:] perl -MConfig -e 'print "$Config{osname} \n"; '
freebsd
xlotl: 52:] uname -a
FreeBSD xlotl 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Tue Jun 11 06:14:12 
GMT 2002 
[EMAIL PROTECTED]:/usr/src/sys/compile/GENERIC  i386
xlotl: 53:]


to show just a few of the specific cases that I am aware of.

As for how this gets set - it gets set when your version of perl
is built for that specific OS.


ciao
drieux

---



Re: Darwin darwin or darwin6.0

2002-11-16 Thread William H. Magill

On Friday, November 15, 2002, at 11:34 AM, Doug McNutt wrote:


What is the "official" name of the operating system under MacOS neXt?

Where does perl get it?


 uname -a
Darwin dun 6.2 Darwin Kernel Version 6.2: Tue Nov  5 22:00:03 PST 2002; 
root:xnu/xnu-344.12.2.obj~1/RELEASE_PPC  Power Macintosh powerpc

I don't know why perl downcases it.
==
For multi-os scripts in ksh I use :

opsys=`uname -a | cut -d" " -f1`
print " opsys = $opsys"
case $opsys in
OSF1)
SunOS)
HP-UX)
AIX)
Darwin|darwin)
esac
etc...

T.T.F.N.
William H. Magill
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]



Re: Darwin darwin or darwin6.0

2002-11-15 Thread Chris Nandor
In article ,
 [EMAIL PROTECTED] (Doug McNutt) wrote:

> What is the "official" name of the operating system under MacOS neXt?

darwin.


> Where does perl get it?

Lowercase uname, same as most (but not all) OSes.

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/