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@example.com
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"`);
exec("uuencode dataout.txt dataout.txt | mail email.to\@sendto.company.com");
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!