Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^5: Trouble emailing zip file

by poj (Abbot)
on Jul 04, 2018 at 20:23 UTC ( #1217903=note: print w/replies, xml ) Need Help??

in reply to Re^4: Trouble emailing zip file
in thread Trouble emailing zip file

Use double quotes not single quotes here

$emailcmd = "/usr/bin/mailx uuencode $zipfile $zipfile -r -s";

Also the quotes can be removed here

my @args = ($emailcmd, $subject, $recipient); poj

Replies are listed 'Best First'.
Re^6: Trouble emailing zip file
by TonyNY (Beadle) on Jul 04, 2018 at 22:32 UTC

    still getting the same error and I have confirmed that the zip file does exist.

      still getting the same error ...

      If by "... the same error ..." you mean
          Can't exec "/usr/bin/mailx uuencode $zipfile $zipfile -r -s": No such file or directory at ...
      then you haven't read and/or understood poj's reply.

      Use double-quotes to interpolate the  $zipfile string into the  $emailcmd string:

      c:\@Work\Perl\monks>perl -wMstrict -le "my $home = $ENV{'HOME'}; print qq{>$home<}; ;; my $zipfile = qq{$home/}; print qq{>>$zipfile<<}; ;; my $emailcmd = qq{/usr/bin/mailx uuencode $zipfile $zipfile -r -s}; print qq{>>>$emailcmd<<<}; " >IsWhereTheHeartIs< >>IsWhereTheHeartIs/<< >>>/usr/bin/mailx uuencode IsWhereTheHeartIs/ IsWhereTheHeartI +s/ -r -s<<<
      Maybe see discussion of  qq// et al and interpolation in perlop. (Basic problem is with string interpolation and not with existence of a file.)

      Give a man a fish:  <%-{-{-{-<

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1217903]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-10-24 03:28 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (242 votes). Check out past polls.