Re: Darwin darwin or darwin6.0
In article p05100300b9fc502960d7@[192.168.1.14], [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
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] URL: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
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
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. -- http://www.interarchy.com/ http://download.interarchy.com/
Re: Darwin darwin or darwin6.0
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. --
Darwin darwin or darwin6.0
What is the official name of the operating system under MacOS neXt? Where does perl get it? I need it so that I can write perl and shell scripts that can be tested on a Mac and then run under Solaris. I solicit comments on the most reliable way to keep things working at least until next week. From Terminal or a BBEdit window: echo $OSTYPE darwin From within a cron job: echo $OSTYPE $HOME/bin/cronlog darwin6.0 uname $HOME/bin/cronlog Darwin From perl executed from terminal: print $^0 -- darwin From perl executed from cron: print $^0 -- darwin From a BBEdit worksheet or from terminal: perl -e 'print `uname`;' Darwin Using bash: if [ $(uname) = Darwin ] ; then works. Note the capital D. It fails with darwin. -- Applescript syntax is like English spelling: Roughly, but not thoroughly, thought through.
Re: Darwin darwin or darwin6.0
In article p05100307b9fad2141fb6@[192.168.1.14], [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/