[a private response was sent - which you neglected to note here]
[don't top post - it's rude]
[reformated message follows]
Mark J Fenbers <> wrote in message news:<>...
> James Willmore wrote:
>
> > On Mon, 01 Mar 2004 10:04:30 -0500, Mark J Fenbers wrote:
> >
> > > $^O gives the O/S name, in my case : 'linux', but I want to run my Perl script
> > > on RH 7.X and RH 9.x of Linux. How can my script determine which version of the
> > > O/S it is running on?
> >
> > Why should your script care about the distro of Linux?
> >
> > More importantly, why are you coding to a certain distro of Linux?
> > That a little like making tall kitchen garbage bags to fit only a certain
> > vendor's tall kitchen garbage can
> Well, because I have third-party software that I call from my script and that
> software has to be called with different environmental settings on RH 9 than it does
> for RH 7.
Keep your eye on the prize - the environment variables, not the OS.
If you code based upon the various distros of Linux, be prepared to
include some 50+ tests (one for each version of Red Hat, plus other
Linux distros). Red Hat is not the only distro out there (I use SuSE
and have tried others, including Red Hat).
My guess is you're looking for, maybe, a language setting? Or a
locale setting? If so, test for the settings, not the distro.
Just a side note - what happens when you get people like me who
*change* the environment settings for one reason or another. What
happens then? From your logic, if I use RH7, and the script sets up
"stuff" based upon the OS, your script *may* fail because I changed an
environment setting you're depending upon being set properly (because
it's that way for RH7 out of the box).
Give some thought to the above statements. Maybe this is all moot. I
just would *not* test based upon a Linux distro. Too many things can
go South real quick.
HTH
Jim
(jwillmore _at_ adelphia _dot_ net)