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

Re: More - Win32 & Linux cross problem

Expand Messages
  • daymobrew
    ... errors as ... in use at ... in use at ... I would recommend rewriting the code to detect the OS on the fly. For example, if the code is to get a listing of
    Message 1 of 2 , Aug 28, 2002
      --- In perl-beginner@y..., John Drabinowicz <jdrab@d...> wrote:
      > Hi Guys, thanks for the advice, but i'm still having problems....
      >
      > I can't use "use" as it pulls in both modules,
      >
      > and when I use "import" or "require" in the if statement, i get
      errors as
      > follows, kinda like it doesn't see the module:
      >
      > C:\Perl\Dev>perl dmc_run.pl
      > Bareword "dmc_Win32_lib::win_find" not allowed while "strict subs"
      in use at
      > dmc_run.pl line 20.
      > Bareword "dmc_Linux_lib::lin_find" not allowed while "strict subs"
      in use at
      > dmc_run.pl line 27.
      > Execution of dmc_run.pl aborted due to compilation errors.
      >
      > C:\Perl\Dev>
      >
      > any help is appriciated.
      >
      >

      I would recommend rewriting the code to detect the OS on the fly.
      For example, if the code is to get a listing of a directory you could
      implement it as follows:

      if ( $^O eq 'Win32' ) # Or whatever it is.
      {
      @listing = `dir /b /on`; # Bare listing sorted by name.
      }
      else
      {
      @listing = `ls`;
      }

      Do your modules run code automatically? (A previous post mentioned
      getting errors when you "use <module_name>" for both modules).
    Your message has been successfully submitted and would be delivered to recipients shortly.