in reply to Unknown error

Update: Oops! Misread OP. Ignore this post.

I get the same error message both ways:

>perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread ... >perl -Mx -e "" Unknown error Compilation failed in require. BEGIN failed--compilation aborted. >perl -e "use x;" Unknown error Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. >perl script.pl Unknown error Compilation failed in require at script.pl line 1. BEGIN failed--compilation aborted at script.pl line 1.

and

>perl -v This is perl, v5.8.0 built for MSWin32-x86-multi-thread ... >perl -Mx -e "" Unknown error Compilation failed in require. BEGIN failed--compilation aborted. >perl -e "use x;" Unknown error Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. >perl script.pl Unknown error Compilation failed in require at script.pl line 1. BEGIN failed--compilation aborted at script.pl line 1.

Replies are listed 'Best First'.
Re^2: Unknown error
by Anonymous Monk on Mar 01, 2006 at 18:45 UTC
    not "perl script.pl" where script.pl probably contains "use x", "perl x.pm" instead. In "::main" instead of "use".