if (($old_word eq $curr_word) and ($old_word2 eq $curr_word2)) { $data = head('http://web/web.html'); print $data->{'_headers'}->{'last-modified'}; use Data::Dumper; my ($dat) = Dumper $data =~ (/'last-modified' => (.*$)/i); print "$dat\n"; #Print to screen here and it does work here. my %mail = ( To => 'you@email.com', From => 'me@email.com', Subject => "NO CHANGE HERE", Message => "$old_word and $old_word2 Web page las updated ->$dat\n", ); $mail{smtp} = 'smtp'; sendmail(%mail) or die "\nProblem! $Mail::Sendmail::error\n"; }