I'm an expert perl programmer who is totally baffled by this very simple 
problem that seem like
there must be an obvious solution that I dont know about.  can any one 
help me

as you know, when a perl command runs the arguments on the command line 
are split
on whitespace and placed in @ARGV

What I want instead is to know the exact input command line, before it 
is split on white space.

You might think, "well just join the @ARGV array and voila!:
but this is not exactly the same thing.  the main differtence is that 
perl removes any surrounding
quotation marks of the split arguments.  I want to capture the exact 
command line with quotes.

THE QUESTION:
There must be some magic perl cpan lib or maybe some magic perl variable 
that can access this string;
where is it??


here is a trivialized example to help make this clear

@ARGV is the same for the following two very different lines

func.pl   ls "-l"

func.pl   ls  -l

suppose that what func.pldis was simply exec(the command line).

exec-ing the string
ls -l
is not the same as execing the string
ls  "-l"

in the former case   -l is an arg to the "ls"  function while in the 
latter the
it is looking for a file name that happens to be called "-l"
(yes a stupid name, but this is a trivial example).

Another case comes up when the embedded string contains white space or 
embedded quotations:
you dont know whether the surrounding quotations were single or double 
quotes since @ARGV removes them.
but this matters when you go to reconstruct the string from the bare 
arguments in @ARGV

ls "spam in a can"
is not the same as
ls spam in a can

and
ls "a quote ' mark"
versus
ls  'a quote ' mark'
verus
ls a quote ' mark

obviously quotemeta can help out here but is not a panacea.













-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to