From: Richard S. Smith on
I am debugging an application under Windows 2003 that calls a Perl script
for logging purposes. The log string looks something like this:

call_type: I alert_id: "29 " data_center: "LA "

I am using a Perl script as the target of this execution, but the trick is
that I need to see the *intact* string that is being passed. By the time
Perl has turned that line into @ARGV the double quotes are gone.

I need to know if there is a way to make perl show me what the OS is
passing it, before the ARGV processing takes place. Using join and @ARGV
to reconstruct the sting is not an acceptable solution for this particular
problem.

Before anyone tells me the OS is removing the double quotes before Perl can
see them, know that if I use a windows .bat and echo the %* variable, I get
the whole line. I need to know if Perl can do that same thing, or not.

If it turns out that NT batch language can do something Perl can't, I'm
going to get some ribbing from my co-workers, so I hope someone can help
me out here.

Thanks, as always.


--
Richard S. Smith / Email: rss(a)idiom.com / Web: http://www.rssnet.org/
--
From: Uri Guttman on
>>>>> "RSS" == Richard S Smith <rss(a)idiom.com> writes:

RSS> I am debugging an application under Windows 2003 that calls a Perl script
RSS> for logging purposes. The log string looks something like this:

RSS> call_type: I alert_id: "29 " data_center: "LA "

RSS> I am using a Perl script as the target of this execution, but the
RSS> trick is that I need to see the *intact* string that is being
RSS> passed. By the time Perl has turned that line into @ARGV the
RSS> double quotes are gone.

perl does not do any processing of @ARGV. i don't know where you got
that idea. shells often do such parsing and their interaction with perl
can be slightly tricky regarding quotes and words.

RSS> I need to know if there is a way to make perl show me what the OS
RSS> is passing it, before the ARGV processing takes place. Using
RSS> join and @ARGV to reconstruct the sting is not an acceptable
RSS> solution for this particular problem.

this is not a perl problem.

RSS> Before anyone tells me the OS is removing the double quotes
RSS> before Perl can see them, know that if I use a windows .bat and
RSS> echo the %* variable, I get the whole line. I need to know if
RSS> Perl can do that same thing, or not.

that is definitely not a perl problem. repeat until blue in the face.

RSS> If it turns out that NT batch language can do something Perl can't, I'm
RSS> going to get some ribbing from my co-workers, so I hope someone can help
RSS> me out here.

prepare thyself for ribbing. this is not a perl problem. you have
different environments/shells calling the perl program and they handle
quoting differently.

one more time. perl never mungs the contents of @ARGV. it contains what
the OS passes to it. how the perl program gets called can affect what
gets passed to it. it is not a perl problem.

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
From: sl123 on
On Tue, 13 Feb 2007 02:39:11 -0000, "Richard S. Smith" <rss(a)idiom.com> wrote:

>I am debugging an application under Windows 2003 that calls a Perl script
>for logging purposes. The log string looks something like this:
>
>call_type: I alert_id: "29 " data_center: "LA "
>
>I am using a Perl script as the target of this execution, but the trick is
>that I need to see the *intact* string that is being passed. By the time
>Perl has turned that line into @ARGV the double quotes are gone.
>
>I need to know if there is a way to make perl show me what the OS is
>passing it, before the ARGV processing takes place. Using join and @ARGV
>to reconstruct the sting is not an acceptable solution for this particular
>problem.
>
>Before anyone tells me the OS is removing the double quotes before Perl can
>see them, know that if I use a windows .bat and echo the %* variable, I get
>the whole line. I need to know if Perl can do that same thing, or not.
>
>If it turns out that NT batch language can do something Perl can't, I'm
>going to get some ribbing from my co-workers, so I hope someone can help
>me out here.
>
>Thanks, as always.
>
>
>--
> Richard S. Smith / Email: rss(a)idiom.com / Web: http://www.rssnet.org/

Whats a simple double quote on the windows cmd line...

c:\>prog.exe \"this is my param"

Better find out if '"' can be escaped on the cmd line. Don't know if it can.
You could always write out the params to a text file before you call the perl script.


From: Mumia W. (NOSPAM) on
On 02/12/2007 08:39 PM, Richard S. Smith wrote:
> I am debugging an application under Windows 2003 that calls a Perl script
> for logging purposes. The log string looks something like this:
>
> call_type: I alert_id: "29 " data_center: "LA "
>
> I am using a Perl script as the target of this execution, but the trick is
> that I need to see the *intact* string that is being passed. By the time
> Perl has turned that line into @ARGV the double quotes are gone.
> [...]

As Uri Guttman said, this is not strictly a Perl problem.

You have to use some function in the Win32 API to get access to the
original command line. There are a variety of Win32:: modules on CPAN
that you should look into. Also look at the Win32 docs on the Microsoft
web site.


--
Windows Vista and your freedom in conflict:
http://www.badvista.org/
From: Joe Smith on
Richard S. Smith wrote:
> I am debugging an application under Windows 2003 that calls a Perl script
> for logging purposes.

How, exactly, is the application calling the perl script?
Is it possible that cmd.exe is in the middle between the app and perl?
-Joe