use vars qw (%params); %params = ( "cc:" => "%HoA{$j}", "Subject" => "A test from ww", "body" => "This is just some simple test text from ww. When you receive it please simply 'FORWARD' it (do NOT 'REPLY') to me at \n\n'ww\@ldisadvantage.org' \n\nso I can confirm that my test ran properly.\n\nThanks, in advance, for your help!\n" ); ( ...debugs removed) sendmail (%params); sleep (120); } (...sub shuffle removed for brevity) sub sendmail { # local %params = @_; $params{Type} = 'text/plain' if ! exists $params{Type}; $params{From} = 'Postmaster@disadvantage.com' if ! exists $params{From}; my $msg = MIME::Lite->new (%params); ### Format as a string: my $str = $msg->as_string; ## error ^ : "no data in this part at mailerww1.pl line 199" print "\n\n\$str is:\n $str \n"; print "\n\n\$str is:\n $$msg \n"; # $msg->send () or die "Message send failed"; return; }