Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Win32 & Linux cross problem

Expand Messages
  • Stern, Leon
    Also $^O for the os name As follows perl -de 1 Loading DB routines from perl5db.pl version 1.0401 Emacs support available. Enter h or `h h for help.
    Message 1 of 3 , Aug 27, 2002
    • 0 Attachment
      Also $^O for the os name
      As follows
      perl -de 1

      Loading DB routines from perl5db.pl version 1.0401
      Emacs support available.

      Enter h or `h h' for help.

      main::(-e:1): 1
      DB<1> p $^O
      aix
      DB<2>

      Leon Stern
      Loma Linda University Medical Center

      -----Original Message-----
      From: Charles K. Clarkson [mailto:cclarkson@...]
      Sent: Tuesday, August 27, 2002 12:07
      To: perl-beginner@yahoogroups.com
      Subject: RE: [PBML] Win32 & Linux cross problem

      John Drabinowicz [mailto:jdrab@...]

      : Hi,
      :
      : I'm trying to build perl scripts that will handle the same
      : problem on Win32 nad Linux but need to go about it
      : differantly, I need to check the registry for a path name in
      : Win32, I can do this already, and I need to do a `ps` to get
      : the path from Linux.
      :
      : The problem is that when I run the scripts on Linux it barfs
      : on the Win32 stuff and when I run it on Win32 (W2k) it barfs
      : on the Linusx commands.
      :
      : I have a central .pl script and the Linux stuff and the Win32
      : stuff are in differant .pm modules, each one works when I
      : comment out the use statement for the other.
      :
      : Any help for me? Been pooring through the books and the web,
      : but no luck so far!

      Use Config. It's a hash. One of its keys is for the
      OS name. I don't remember which one. Run this on both
      machines.

      use Data::Dumper
      use Config;

      print Dumper \%Config;

      Look for the key that names the operating system. Then
      use a conditional to load modules for each system. You
      won't be able to use 'use' for module loading though. Try
      'require' and 'import' (I think).

      if ( $Config{ OS_key } =~ $ms_oper ) {
      .
      .
      .
      .

      } else {
      .
      .
      .
      .

      }


      HTH,


      Charles K. Clarkson
      --
      Head Bottle Washer,
      Clarkson Energy Homes, Inc.
      Small commercial and residential rehabilitation specialists.
      254 968-8328

      CJ Web Work - Solutions for Real Estate Investors.
      972 216-4952

      CJ Web Hosting - Lookout; We have one whole paying customer!
      254 968-8328



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.