in reply to Cross-Platform code

I have the info I need to get rid of my path separator variable and probably to stop editing the #! line every time I copy the code to Windows.

I can move my module to one of the standard directories from @INC.

I still have to edit my config. file when I move the code, though. That's actually not too much of a burden, but I think I may have found my solution in the %ENV variable SERVER_SOFTWARE: on the Linux server it shows Apache/2.0.55 (Unix) ... and on the Windows server it shows Apache/2.0.55 (Win32) ... ... That'll work :D

--
-- GhodMode

Replies are listed 'Best First'.
Re^2: Cross-Platform code
by acid06 (Friar) on Feb 06, 2006 at 03:15 UTC
    Perhaps you should use the $^O special variable instead, since it doesn't depend on a CGI environment.
    It contains a descriptive name for the OS (e.g. "MSWin32" under Windows).


    acid06
    perl -e "print pack('h*', 16369646), scalar reverse $="
      Dude!! You Rock!! That's what I was looking for in the first place :)
      --
      -- GhodMode
      

      Or you can use the Config module, if you need more information about the system.

      If you're using regular CGI's (and doesn't need mod_perl) you can use Cygwin at the Windows station, without problems. You will avoid annoyances with IIS, permissions or registry. But if you need mod_perl, just forget about. I recently (two weeks ago) had tried to use Apache 2 with Cygwin and it just didn't worked. Looking for answer at Google brought info related to wrong compilation problem and, well... I quit trying!

      Alceu Rodrigues de Freitas Junior
      ---------------------------------
      "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill