in reply to Trouble emailing zip file

system("uuencode ${logfile} ${logfile} | mailx -s ${subject} -r ${rec +ipient1}");

Your $subject contains whitespace. Think about how that's going to affect the mailx command. Why not use a module instead of the shelling-out kludge?

if ($userid = $user1){

That's an assignment rather than a test of equality. Also you haven't declared @email so probably the receipient address is wrong too. Time to read the Basic Debugging Checklist maybe?

Replies are listed 'Best First'.
Re^2: Trouble emailing zip file
by TonyNY (Beadle) on Jul 03, 2018 at 13:42 UTC

    Hi hippo

    I guess I need to get into the habit of using chomp to take care of the white spaces.

    Regarding the use of email modules. My work environment is so strict and chances are that we don't have the modules installed.

    What is the command to check if a module is installed?

    Thanks for you help.

      I guess I need to get into the habit of using chomp to take care of the white spaces.

      chomp won't save you here because the whitespace is in the middle of $subject and you probably do actually want to retain the spaces anyway.

      My work environment is so strict and chances are that we don't have the modules installed.

      Which OS? Many of them have packages for perl modules.

      What is the command to check if a module is installed?

      TIMTOWTDI but a simple test to see if (eg.) DBI is installed could be

      perl -MDBI -e 1

      which will just return you to the prompt if it is loaded or throw an error otherwise.

        "Which OS? Many of them have packages for perl modules."

        Solaris 10

      perldoc -l The::Module

      tells you

      No documentation found for "The::Module"

      ... and

      perl -MThe::Module=99999999 -e1

      tells you

      Can't locate The/Module.pm in @INC (@INC contains: ...)

      ... for misssing modules.

      If the module actually is installed, both will output nothing.

        Thanks!