develooper Front page | perl.perl6.language | Postings from January 2001

Re: JWZ on s/Java/Perl/

Thread Previous | Thread Next
David Grove
January 29, 2001 08:24
Re: JWZ on s/Java/Perl/
Message ID:

Jarkko Hietaniemi <> wrote:

 > The desire to know the name of the runtime platform is a misdirected
 > desire.
 > What you really want to know is whether function Foo will be there,
 > kind of signature it has, whether file Bar will be there, what kind of
 > format it has, and so on, whether a feature Zog is present, or what
 > is the value of parameter Blah.  Just knowing the name of the platform
 > doesn't buy you a whole lot.

It's not limited to perl functionality. I need to know what version of
which can be assumed to be there, and which api are available. Knowing the
operating system type (generic) and version (specific) are both helpful
for purposes apart from knowing what perl functions are available. In
fact, for the latter purpose, I have only used this functionality a couple
of times, whereas the former are in a large number of my programs.

Also, I find $^O quite helpful as "MSWin32" simply to find out whether or
not it's a UN*X operating system. I need to run shell calls or what not
depending on that generic platform. Although I often care what specific
version of Win32 I have (and what my running linux kernel version is),
that need I find to be much rarer.

if($^O eq "MSWin32"){
  `notepad c:\temp\foo$num.txt`
else {
  if(-x $ENV{EDITOR}){
    `$ENV{EDITOR} /tmp/foo$name.txt`
  else {
    `vi /tmp/foo$name.txt`

Obtaining the platform name quickly and easily buys quite a bit, is quick,
and is hugely important to streamlined code. Knowing the version is, to
me, rarer and not as important (not to insinuate that it isn't important
to some).


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About