Mark_Nelson
asked on
uuencode problem with perl on hpux
First, I have read through a number of previous posts here about uuencode and perl. As soon as I finish writting this, I'm going to explore MIME::Lite , but I'm curious as to the problem I'm having with uuencode right now.
Now keep in mind that I'm having to work with HPUX 11i and perl 5.005_03 (long story about not upgrading) and I'm still relatively new to perl.
I have a text file generated out of some previous sql/perl mix. Lets call it dataout.txt.
The gist of the problem is this:
outside of perl, I can use the following code uuencode dataout.txt dataout.txt | mailx -s "extracted data" email.to@sendto.company.co m
and it works fine.
However, when I use either of the following in a perl script:
system(`uuencode dataout.txt dataout.txt | mail "email.to\@sendto.company. com"`);
or
exec("uuencode dataout.txt dataout.txt | mail email.to\@sendto.company.c om");
I still get an email with an attachement, but the attachment does not contain the data as it does if I use the same command from the unix command line.
As a 4 year old likes to say, "Why?" .
Thank you in advance!
Mark Nelson
Now keep in mind that I'm having to work with HPUX 11i and perl 5.005_03 (long story about not upgrading) and I'm still relatively new to perl.
I have a text file generated out of some previous sql/perl mix. Lets call it dataout.txt.
The gist of the problem is this:
outside of perl, I can use the following code uuencode dataout.txt dataout.txt | mailx -s "extracted data" email.to@sendto.company.co
and it works fine.
However, when I use either of the following in a perl script:
system(`uuencode dataout.txt dataout.txt | mail "email.to\@sendto.company.
or
exec("uuencode dataout.txt dataout.txt | mail email.to\@sendto.company.c
I still get an email with an attachement, but the attachment does not contain the data as it does if I use the same command from the unix command line.
As a 4 year old likes to say, "Why?" .
Thank you in advance!
Mark Nelson
ASKER
jmcg;
The same thing happens if mail or mailx is used.
Actually, the email comes with an attachment of the proper name but a zero byte lengtht.
This is a text message and needs to come as an attachment, not in the body of the message.
I'm futzing with MIME::Lite now. Just got the package installed and typed out a test script that failed ;).
Mark
The same thing happens if mail or mailx is used.
Actually, the email comes with an attachment of the proper name but a zero byte lengtht.
This is a text message and needs to come as an attachment, not in the body of the message.
I'm futzing with MIME::Lite now. Just got the package installed and typed out a test script that failed ;).
Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
as a final note to this saga, I was never able to get PERL to properly send the txt file as an attachment.
I tried the system(`uuencode.......)
I tried MIME::Lite as well.
However, when I wraped PERL in KSH and called the PERL code to do the data manipulation, then when it was done, return to KSH, I was able to get KSH to run the uuncode line just fine.
Shrug
:)
Mark Nelson
I tried the system(`uuencode.......)
I tried MIME::Lite as well.
However, when I wraped PERL in KSH and called the PERL code to do the data manipulation, then when it was done, return to KSH, I was able to get KSH to run the uuncode line just fine.
Shrug
:)
Mark Nelson
Sometimes a problem takes too long to solve and you gotta get by with something that you realize is makeshift, but it _works_.
What happens if you use mailx from Perl?
Is it that the attachment is not there at all, is it empty, or is it simply not being recognized as an attachment by the recipient's mailer?
MIME::Lite is a better way to do this.