Re: windows program return values vs perl return values from a call to system() -- windows post only



Purl Gurl wrote:
Fred wrote:

my $prog_to_B_run="C:\\WINNT\\system32\\notepad.exe";

Change your command line to,

$prog_to_B_run="C:\\bad\\path\\to\\notepad.exe";

Observe results. You need to perform a little fine tuning.



#!perl

$prog_to_B_run="c:\\bad\\path\\to\\notepad.exe";

$stat = system("$prog_to_B_run") || die "$!";

print "STAT: $stat\n";

***

C:\APACHE\USERS\TEST>perl test.pl
Bad command or file name
No such file or directory at test.pl line 5.

Without a die, your original code will return
a zero success, then execute your else block
which indicates notepad ran successfully,
when actually a "Bad command or file name"
error message is generated.


Purl Gurl

.



Relevant Pages

  • Re: windows program return values vs perl return values from a call to system() -- windows p
    ... a zero success, then execute your else block which indicates notepad ran successfully, when actually a "Bad command or file name" error message is generated. ...
    (comp.lang.perl.misc)
  • How can I reset the error counter displayed by "netstat -i" [Virus checked HSH Nordbank]
    ... I want to monitor the errors on the interfaces of some SUN Solaris servers. ... But i could not find a way or command to reset this counters to zero. ... Zugriff oder unbefugte Weiterleitung, die Fertigung einer Kopie, die ... Vervffentlichung oder sonstige in diesem Zusammenhang stehende Handlung ist ...
    (SunManagers)
  • Re: Message Box
    ... The original code behind the Command Button on click event "DoCmd.Close" still closes the form losing any data entered. ... On my form "frmExitDate" I have a field called "ExitDate" and a command button called "cmdCloseExitForm" The Field "frmExitDate" needs to be completed if a student has left the college. ... However if the Data entry person has opened this form by accident and the student has not left the College, I obviously need to be able to close the form without completing the field. ...
    (microsoft.public.access.forms)
  • Re: Windows/Macro Language Info?
    ... ueber Re: Windows/Macro Language Info? ... Also there was a command line version with ... "Die Interessen der Nation lassen sich nicht anders formulieren als unter ...
    (comp.lang.cobol)
  • Re: question on file locking
    ... The command here is F_SETLK. ... Using your original code, here is what I see tracing the first instance: ... And, while this process is running, a second instance blocks in fcntl: ... This call returns when the first process terminates. ...
    (comp.unix.programmer)