use Foo2Mail; # use LWP::Simple::get to fetch from url # use quick year/month/day date as id sub fetch { my ($self, $name, $target) = @_; my $content; if ($content = get($target)) { return { name => $name, content => $content, id => (localtime())[5,4,3], }; } else { $self->error('Failed to fetch $name ($target)'); return undef; } } my %to_fetch = ( a_site => 'http://example.com/example.html', b_site => 'http://example.com/example2.html', ); my $f2m = Foo2Mail->new( fetch => \&fetch, to_fetch => \%to_fetch, to => 'user@example.com', from => 'f2m@example.com', subject => 'Foo2Mail output', ) or die $Foo2Mail::ERROR