in reply to Wisdom sought re:mail:sendmail attachments

the code from the FAQ works for me, but it's a bit messy.

I'd think they should have used $file everywhere after they set it, instead of using $^X all over the place...

$^X gives the full path to the perl executable, so that's what's attached...

in the sample, from line 25 on, s/$^X/$file/ - then set file to whatever you want to attach and you're off to the races...

  • Comment on Re: Wisdom sought re:mail:sendmail attachments

Replies are listed 'Best First'.
Re^2: Wisdom sought re:mail:sendmail attachments
by bradcathey (Prior) on Jan 24, 2005 at 13:18 UTC

    Thanks YetAnotherDave. To clarify: I need to have the attachment uploaded to the web host already, right? That I do with traditional means.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
      yes, this just takes a file directly from the machine the script works on.

      note that the file as named in the attachment has nothing to do with the name of the file as you read it, so you can use mktemp (see File::Temp) to generate a temp file without penalty.