views:

390

answers:

3

I'm on Windows using Strawberry Perl. I run perl Makefile.pl for the Buckwalter Encode module, that works fine. When I run make, it says

Execution of -e aborted due to compilation errors

What is -e? Which file do I go to fix the error? Apparently there's a missing curly bracket on line 1, but I don't know which file has that missing curly bracket so I don't know where to look.

+2  A: 

We use perl's -e option to specify on the command line code to be executed. From perlrun:

  • -e commandline
    may be used to enter one line of program. If -e is given, Perl will not look for a filename in the argument list. Multiple -e commands may be given to build up a multi-line script. Make sure to use semicolons where you would in a normal program.

For example:

$ perl -e 'print "Hello, world!\n"'
Hello, world!

An error similar to the one you're seeing is

$ perl -e 'while (1) { print "foo!"'
Missing right curly or square bracket at -e line 1, at end of line
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
Greg Bacon
A: 

Well, from make to dmake to cpan.. I just switched to using the CPAN client, and did "test Encode::Buckwalter" and then "install Encode::Buckwalter" and it worked fine! Don't know why the errors happened then... perhaps some platform issues..

asaaki
On Windows, Perl uses either `nmake` or `dmake`. You might have a `make.exe`, but I doubt it's the one Perl expects. I believe you have to use the make that your Perl was compiled for. Try `perl -e "use Config; print $Config{make}"` to see which kind of make it wants.
cjm
A: 

When you run perl Makefile.PL, you create a file called Makfefile. Inside that file are various targets, such as test and install, that do the real work. Some of those are implemented as Perl one-liners using -e.

You've already solved your problem by using the right variant of make, though.

brian d foy