in reply to Perl Script Email error

Your $hostname has a trailing newline - you should chomp it first:

my $hostname=`hostname`; chomp $hostname; # ... etc.

Replies are listed 'Best First'.
Re^2: Perl Script Email error
by choroba (Cardinal) on Jun 14, 2016 at 23:33 UTC
    Or, use Sys::Hostname and its hostname function to prevent shelling out and getting the newline in the hostname.
    use Sys::Hostname; my $hostname = hostname(); ...

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re^2: Perl Script Email error
by cbtshare (Monk) on Jun 15, 2016 at 13:28 UTC
    I thank you :)