> Hi,
> 
Howdy

> I am no fan of Bill Gates either :) but the client
> needs to use his crap. The simplified version of code
> is:
> 

Ok, some thigns I'd do is:

1) use strict; and use warnings; if winders has them.
2) Make you variabels my() variables; (IE my $arg1 ... Instead of $arg1 ...)
3) changeg system() line to :
        system("C:\\perlcode\\validate.exe $arg $arg2") or die "System call failed $!";

> .....
> $arg1="userid";
> $arg2="password";
> @args = ("C:\\perlcode\\validate.exe","$arg1","$arg2");
> system(@args);
> $exit_value  = $? >> 8;
> $signal_num  = $? & 127;
> $dumped_core = $? & 128;
        Just curious, what is happening here with the >> and the &.
        I see there's a 128 there, perhaps that's where it is coming from?

> print "$exit_value, $signal_num, $dumped_core\n";
> .....
> 
> validate.exe is the C executable, that validates the 
> credentials against a database on some other machine. When 
> called from IIS, system call never makes it to the 
> validate.exe. $exit_value is 128 (instead of 0).
> 

Since it's comign from a webserver do you have an 
apropriate contetn type header before any output?
What do your logs say about it?

> Thanks
> Atul
> 
> On Tue, 6 Jan 2004 12:56:50 -0600, "Dan Muey" wrote:
> 
> > 
> > > Hi,
> > 
> > Howdy
> > 
> > > 
> > > We have a perl/cgi script (ActivePerl 5.8) which
> calls
> > > a executable (C code) using the system command.
> > > Ex:
> > > .....
> > > @args = ("C:\\perlcode\\sample.pl", "arg1",
> "arg2"); 
> > > system(@args); $exit_value  = $? >> 8; $signal_num
> =
> > $? &
> > > 127; $dumped_core = $? & 128; print "$exit_value,
> > > $signal_num, $dumped_core\n"; .....
> > 
> > sample.pl is the C prog or it calls the c prog?
> > How does sample.pl set the values you're looking for?
> > 
> > > The above code works fine from the command prompt
> and 
> > > exit_value, signal_num and dumped_core are all 0.
> The
> > same
> > > perl /cgi script when called from a web page (IIS
> > server)
> > > returns exit_value to be 128 (what does it
> mean)?????
> > i.e. C
> > 
> > Ask bill gates :) Just kidding (sort of).
> > Hard to say without knowing what/where/how/who/when
> > these values are being set.
> > Also IIS is, with all due respect and apologies for
> > being OT, crap.
> > 
> > I'd refer to IIS manual and see what 128 means to it.
> > Or does 128 come from your c prog, if so what does 128
> > mean to it?
> > Or does 128 come from sample.pl, if so what does it
> > mean to it?
> > 
> > > code fails. What could be wrong. Is there any IIS
> > setting
> > > required, I did add the .pl extension to IIS.
> > > 
> > > Please help
> > 
> > We need to see your sample.pl code and know what the c
> > prog
> > is all about to help you with why the current script
> is
> > acting a certain way.
> > 
> > > 
> > > Atul
> > 
> > DMuey
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to