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.)
I don't know an easy way around this offhand. Perhaps oneliner() ought to simply eliminate newlines, instead of escaping them. I suspect that brings in different line-length issues, but in the context of oneliner() in MM_Unix.pm, it might not matter.
Yep, make doesn't strip the trailing '\\\n'. Note that this makes some degree of sense when the normal thing that gets passed the make action is /bin/sh.
However, I've thought of a nasty hack: stick a '#' character before the \ - that way perl will ignore it:
broke:
@perl -le 'eval {print "First line."} \
or print "Second line.";'
ok:
@perl -le 'eval {print "First line."} #\
or print "Second line.";'$ make broke
Backslash found where operator expected at -e line 1, near "} \"
(Missing operator before \?)
syntax error at -e line 1, near "} \"
Execution of -e aborted due to compilation errors.
*** Error code 255
make: Fatal error: Command failed for target `broke'$ make ok First line.
However this will only work if you know the command that will be executed is perl!
The other alternative is just not to try to wrap lines - on Solaris at least ARG_MAX is 1048320.
-- Alan Burlison --
