On Thu, Nov 15, 2001 at 01:50:47PM +0100, Bart Lateur wrote: > On Thu, 15 Nov 2001 07:42:41 -0500, Keith C. Ivey wrote: > >If we're not cheating at all, the program has to be a LOT > >longer.
"#define" is fine to pass to the CPP. It's most likely a user CPP mistake and not a real Perl comment. -P is fundamentally borked anyway. First, #! is stripped which means all those switches are ignored. More importantly, not all /^#/ lines are comments. $foo <<EOF; # this sure isn't a comment EOF But as long as this solution isn't any more fundamentally borked than the current one, it's ok. -P has one foot in the grave anyway. I can count the number of real programs that need -P on my left hand, and I'm wearing mittens. > The same solution would be to crteate an actual script instead of a > one-liner, and pipe the data through it. (But where's the fiun in that? > ;-) > > Can you pipe on VMS? vmsperl emulates it inside system() and `` commands. Otherwise you have to use the 'pipe' command. This all works, BTW. http:[EMAIL PROTECTED]/msg04899.html The end result winds up looking like: pipe mcr $1$dkb300:[schwern.src.perl-current.][000000]perl.exe -ne"/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print" t/comp/cpp.aux | CC/DECC/noobj/comments=as_is/preprocess=sys$output sys$input Breaking it down of the morbidly curious (my understanding might be a little off, I'm just visiting here in VMSworld). "pipe" It's necessary to tell VMS "I'm going to use a pipe here" "mcr" The rough equivalent of saying "this is a shell program" "$1$dkb300:[schwern.src.perl-current.][000000]perl.exe" The absolute path to the perl executable. disk:[path.to.the.]program.exe I have no idea what the [000000] is about. "-ne"/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print" t/comp/cpp.aux" Paradoxically, this is the easy part to understand. ;) "CC/DECC/noobj/comments=as_is/preprocess=sys$output sys$input" Invokes the DECC C compiler telling it not to produce any object files, to leave all comments as they are (otherwise it will try to strip //), that it should preprocess STDIN and dump it to STDOUT. -- Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One Right Wing Enema: Flush Immorality Now! God gums gay gorgings. -- boojum
