Re: More - Win32 & Linux cross problem
- --- In perl-beginner@y..., John Drabinowicz <jdrab@d...> wrote:
> Hi Guys, thanks for the advice, but i'm still having problems....errors as
> I can't use "use" as it pulls in both modules,
> and when I use "import" or "require" in the if statement, i get
> follows, kinda like it doesn't see the module:in use at
> C:\Perl\Dev>perl dmc_run.pl
> Bareword "dmc_Win32_lib::win_find" not allowed while "strict subs"
> dmc_run.pl line 20.in use at
> Bareword "dmc_Linux_lib::lin_find" not allowed while "strict subs"
> dmc_run.pl line 27.I would recommend rewriting the code to detect the OS on the fly.
> Execution of dmc_run.pl aborted due to compilation errors.
> any help is appriciated.
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.
@listing = `ls`;
Do your modules run code automatically? (A previous post mentioned
getting errors when you "use <module_name>" for both modules).