When I run the application locally it sets the environment variable $status to 4. .... system($cmd;echo $status);Have you tried that? AFAIK you can't "push" environment variables to the parent process (in this case the shell) on UNIX - i.e. if you set an env variable it will only affect the current process and it's children.
I would probably just print out the value to STDOUT and retrieve it in the perl process using backquotes. Setting variables and then echo()ing them is useless overhead.
that way you're much more flexible and it's easier to debug since you can immediately see the output if you run the program on its own.my $output = `some-program`; print "Output from some-program is '$output'";
In reply to Re: return values with system()
by Joost
in thread return values with system()
by jason
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |