Re: windows program return values vs perl return values from a call to system() -- windows post only
- From: Purl Gurl <purlgurl@xxxxxxxxxxxx>
- Date: Sat, 29 Oct 2005 17:16:00 -0700
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: Timelocal input, post good Date filters (from - to)
- Next by Date: Re: windows program return values vs perl return values from a call to system() -- windows post only
- Previous by thread: windows program return values vs perl return values from a call to system() -- windows post only
- Next by thread: Re: windows program return values vs perl return values from a call to system() -- windows post only
- Index(es):
Relevant Pages
|
|