system() and exec() don't execute but don't die either 
Author Message
 system() and exec() don't execute but don't die either

Hello,

I have the following code:


This doesn't die, but never sends the mail. The same command issued at a
prompt works just fine. Replacing system() with exec() or backticks (and
getting rid of the ' == 0') doesn't do any good. I have read the man
pages on system() and exec() but still didn't see what I am doing wrong.
Any help would be greatly appreciated.

Thank you,
Katia Hayati



Sat, 29 Nov 2003 06:45:01 GMT  
 system() and exec() don't execute but don't die either

Quote:

>Hello,

>I have the following code:


>This doesn't die, but never sends the mail. The same command issued at a
>prompt works just fine. Replacing system() with exec() or backticks (and
>getting rid of the ' == 0') doesn't do any good. I have read the man
>pages on system() and exec() but still didn't see what I am doing wrong.
>Any help would be greatly appreciated.

When ytou system() a command with a pipe, the exit status is for
one of the processes only, in this case usualy the cat command.

Suggest you loose the cat command:


or


And also check what might be written to standard error, usualy the
terminal, but you could redirect STDERR to a file in perl before
you call system().

Villy



Sat, 29 Nov 2003 15:43:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. getting hostname and ip addr when you don't have either

2. die/warn don't work

3. But, I don't wanna die !!!!!

4. Command line instructions don't execute in Win95

5. system() process don't always kill

6. (newbie) Don't understand '$_'

7. my ioctl's don't work

8. strange regex behaviour - don't understand what's going on

9. I'm tainted and I don't know why

10. Demo programs from O'Reilly Book don't work

11. system and exec 'holds' perl output

 

 
Powered by phpBB® Forum Software