Re: [Module::Build] ./Build on Win98
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <ml...@th...> - 2006-03-01 23:17:27
|
Ken Williams wrote: > > On Feb 28, 2006, at 8:33 PM, Randy W. Sims wrote: > >> Ken Williams wrote: >>> On Feb 25, 2006, at 1:32 PM, Randy W. Sims wrote: >>>> Ok, here's the problem. The quoting is wrong in the invokation of >>>> pl2bat. Both arguments to pl2bat got bungled into one misformed arg. >>>> I need to figure out how to invoke pl2bat from the command line with >>>> corrected quoting. The command we're using now, that produces the >>>> bungled last line above is: >>>> >>>> pl2bat -n "-x -S """%0""" --build_bat %*" -o "-x -S """%0""" >>>> --build_bat %1 %2 %3 %4 %5 %6 %7 %8 %9" < Build > Build.bat >>>> >>>> It looks like it is trying to expand %*" -o "-x -S """% as an >>>> evironment var. Maybe an extra space after %*: >>>> >>>> pl2bat -n "-x -S """%0""" --build_bat %* " -o "-x -S """%0""" >>>> --build_bat %1 %2 %3 %4 %5 %6 %7 %8 %9 " < Build > Build.bat >>>> >>>> Otherwise, I'm not sure how to quote the percent symbol (%%* doesn't >>>> work). I've posted a message over on alt.msdos.batch about this. >>> Won't the multi-argument form of system() be helpful here? It's >>> generally much easier to get that to work out than trying to get >>> quoting right. >> >> It doesn't seem so... In order to use redirection in the command >> that's executed, the shell must be invoked. > > Yuck. Short of converting pl2bat into module form, is there some other > sneaky solution? Maybe set @ARGV and then do($pl2bat), with STDOUT tied? > > If there's one thing I hate, it's shell quoting just to call another set > of perl code. All the solutions I can think of, and the one you mention above are all variations on a theme. None of them are ideal, so I have no outstanding preference. Options are: 1) Rearrange the command to put the unquotable(?) construct at the end of the command line. Subject to fail later when code is modified and inadvertently changes order. 2) Stuff @ARGV and do 'pl2bat.bat' as you suggest. Makes me nervous; kinda depends on knowing pl2bat internals are safe to C<do>. Also, more hoops because we have to tie stdin & stdout in place of redirection. 3) Wrap pl2bat in a module and publish it. 4) Copy the code from pl2bat[1] directly into M::B::P::Windows; It's short, and can be abbreviated somewhat for our purpose, but it still duplicates code. I probably like (1) the least, and I guess I lean more towards (3) or (4) Your preference? Randy. 1. <http://search.cpan.org/src/NWCLARK/perl-5.8.8/win32/bin/pl2bat.pl> |