On Tue, Jun 10, 2003 at 09:47:43AM -0400, Andy Dougherty wrote:
> So the issue is that with GNU make (and 4.4BSD make), perl ends up
> seeing
>
> -le 'eval {print "First line."} or print "Second line.";'
>
> But with Sun's /usr/ccs/bin/make, perl sees
>
> -le 'eval {print "First line."} \
> or print "Second line.";'
>
> (It's possible that other SVR4-related make commands will suffer the
> same fate. SVR4-derived systems have traditionally been under-
> represented on p5p, so it's hard to know.)
Could someone dig up some definate documentation on this behavior?
> I don't know an easy way around this offhand. Perhaps oneliner()
> ought to simply eliminate newlines, instead of escaping them.
That's a fallback. It does produce a different program, consider:
perl -wle 'print "Hello
World!"'
but in the context of MakeMaker its good enough to say "don't do that".
> I suspect that brings in different line-length issues, but in the
> context of oneliner() in MM_Unix.pm, it might not matter.
No line length problems. The shell will gag before make does.
The problem is more one of making readable code and a readable Makefile.
Eliminating newlines will leave the code in the module readable but the
Makefile smashed together. However, with all the shell escaping going on
its pretty hard to read as it is.
Try this hack.
--- lib/ExtUtils/MM_Unix.pm 10 Jun 2003 07:06:41 -0000 1.166
+++ lib/ExtUtils/MM_Unix.pm 10 Jun 2003 21:32:17 -0000
@@ -3567,7 +3567,8 @@
$cmd =~ s{\n+$}{};
$cmd = $self->quote_literal($cmd);
- $cmd = $self->escape_newlines($cmd);
+# $cmd = $self->escape_newlines($cmd);
+ $cmd =~ s{\n}{ }g;
$switches = join ' ', @$switches;
--
My lips, your breast and a whole lotta strange arguing.