|
Prev: What's happening with the last child process here????
Next: WWW:Mechanize single quotes around URL causes problem
From: g4173c on 11 Jan 2007 13:01 Hi: I've been reading perldoc -f system and have been trying: system ("verix -i ${design}.ctl") == 0 or die "ERROR: verix -i ${design}.ctl Failed!, Please check verix.log\n"; To get the return value. I see the program doing: **> exit 1 However it doesn't execute the die command. I've also tried this in and If statement and other things, but without any luck. Any ideas what else I could try? Thanks is advanced for any help here! Tom
From: Paul Lalli on 11 Jan 2007 13:10 g41...(a)motorola.com wrote: > I've been reading perldoc -f system and have been trying: > > system ("verix -i ${design}.ctl") == 0 or die "ERROR: verix -i > ${design}.ctl Failed!, Please check verix.log\n"; > > To get the return value. > > I see the program doing: > > **> exit 1 What does it mean that the program is "doing" that? Is that output that the verix program generates? Or is that a line of code in verix that you think it should be executing? > However it doesn't execute the die command. Then system() is pretty clearly returning 0. > I've also tried this in and > If statement and other things, but without any luck. Any ideas what > else I could try? I don't really understand what your question is, or what problem you're trying to solve. My *guess* is that you are under the belief that the verix program is exiting with a status of 1, and that the Perl program is therefore wrong because it's not executing the die() statement. Is that correct? If so, I respectfully disagree. If the die() statement is not executing, then system() returned 0. Period. No other way around it. Your assumption about what verix exited with, therefore, is wrong. Why not simply run the verix command in a shell, and echo out the value of $? to see what it actually is? You can also try capturing the value of system, and/or print the value of $? from within the Perl script: my $retval = system ("verix -i ${design}.ctl"); if ($retval != 0) { die "ERROR: verix -i ${design}.ctl Failed: $retval ($?)\n"; } else { warn "I think something's wrong - system() returned 0 ($?)\n"; } Paul Lalli
From: g4173c on 11 Jan 2007 13:24
> You can also try capturing the value of system, and/or print the value > of $? from within the Perl script: Good idea, tried that and got: **> exit 1 0 This is what Verix program does after it finds an error, however doesn't seem to set the return value correctly. Thanks for the help! Tom |