in reply to Using system with mailx

As others in this thread have stated there are many reasons why this could be happening and without amplifying information there is no way to tell what is going on.

Nevertheless let me forge on with a suggested change in your strategy:

I am mildly curious: why isn't this an option? It would certainly be a much cleaner approach in my honest opinion...

Hope this helps.


Peter @ Berghold . Net

Sieze the cow! Bite the day!

Test the code? We don't need to test no stinkin' code! All code posted here is as is where is unless otherwise stated.

Brewer of Belgian style Ales

Replies are listed 'Best First'.
Re: Re: Using system with mailx
by cutter (Acolyte) on Aug 06, 2003 at 14:42 UTC
    I agree, but the mail PM are not installed on all of the servers and I can't get the SA's to install them.

    Thanks for the suggestions. I will check the log files as pointed out in the other posts and see if I can figure out the problem.

      What makes you think you need the SA to install a module?
      $ perldoc -q 'own module'

      Abigail

Re: Re: Using system with mailx
by Anonymous Monk on Aug 06, 2003 at 15:16 UTC
    In addition to checking the result of the open() call, I would also recommend checking the result of the close() call, especially when the file handle is opened to a piped program.
        :
        close PIPE 
            or die $!;
        :
    
      I just read "perldoc -f close" which leads me to an even better example showing a non-zero exit status. If mailx is having problems, not checking the result of the close() call could easily hide those problems.
          close PIPE
              or die $! || "exit status $?";
      

      While you are technically correct I have actually seen cases where turning warnings on will produce spew falsely about using "or die" on close. I just tried to duplicate it but I don't remember where I ran into it. (AIX?)


      Peter @ Berghold . Net

      Sieze the cow! Bite the day!

      Test the code? We don't need to test no stinkin' code! All code posted here is as is where is unless otherwise stated.

      Brewer of Belgian style Ales