Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2002 14:50:45 -0500
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        "Charles Burns" <burnscharlesn@hotmail.com>, ilia@chel.skbkontur.ru, questions@FreeBSD.ORG
Subject:   Re: Perl thing
Message-ID:  <20020324195045.EF418BA05@i8k.babbleon.org>
In-Reply-To: <F140eOdU8uudgUWr81n000207c8@hotmail.com>
References:  <F140eOdU8uudgUWr81n000207c8@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 24 March 2002 02:46 pm, Charles Burns wrote:
| IANAPP (Perl Programmer) but I know that Perl is great for text parsing.
| One way that you could do this, though it wouldn't exactly be elegant,
| would be to parse the output of (say) dmesg. Surely though, there are
| better ways.
|
| >Dear Sirs,
| >
| >is there anything that I could use it in perl program like I can write in
| >C:
| >
| >#ifdef __FreeBSD__
| >
| >#endif
| >
| >???
| >
| >I want to port some perl program that it could run either on FreeBSD or
| >any other system...

Howzabout

   if ($ENV{'OSTYPE'} eq 'FreeBSD') {
   }

I'm not an expert on this; I just did a printenv | grep BSD and both OSTYPE 
and HOSTTYPE are set to FreeBSD.  I'm not sure if that's always the case, but 
I do know that it's always the case that you can use $ENV to get to 
environment variables.

I also checked, and these are set for root and for a from-scratch user 
account, so they are probably safely universal.

|
| _________________________________________________________________
| Chat with friends online, try MSN Messenger: http://messenger.msn.com
|
|
| To Unsubscribe: send mail to majordomo@FreeBSD.org
| with "unsubscribe freebsd-questions" in the body of the message

-- 
Brian T. Schellenberger . . . . . . .   bts@wnt.sas.com (work)
Brian, the man from Babble-On . . . .   bts@babbleon.org (personal)
                                ME -->  http://www.babbleon.org
http://www.eff.org   <-- GOOD GUYS -->  http://www.programming-freedom.org 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020324195045.EF418BA05>