Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Module naming advice

by mr_stru (Sexton)
on Aug 11, 2003 at 11:55 UTC ( [id://282827]=perlquestion: print w/replies, xml ) Need Help??

mr_stru has asked for the wisdom of the Perl Monks concerning the following question:

I've got some code kicking around that I'd like to package up and release. The only problem is the name (and I'm also not sure how generally useful it is).

At the moment the module glories under the name Foo2Mail and works like this:

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

Essentially it allows you to specify a hash of information about data to be turned into emails, a sub to transform that into suitable content and then it generates and sends mails keeping track of what's been sent and only sending things once.

Given that it deals with Mail I imagine it should go into the Mail heirarchy somewhere but I can't think of a useful name so I thought I'd ask here for suggestions.

If you want to look at it then it's available from exo.org.uk

Ta

Struan

Replies are listed 'Best First'.
Re: Module naming advice
by halley (Prior) on Aug 11, 2003 at 15:50 UTC
    That function (parameterized mail content) has long been referred as 'Mail Merge' by the word processing and secretarial types.

    Of course, I cringe at the onslaught of spam e-mails generated by the module.

    --
    [ e d @ h a l l e y . c c ]

      I guess is is mail merge. I am on the other hand hesitant to call it Mail::Merge as that rather implies it does mail merge in the word processing sense which isn't true. It's much more generic that that.

      And yup, I'm sure you could use it to spam people. But then the same is true of MIME::Lite, Mail::Mailer or the handily named Mail::Bulkmail. If the only application of the module was spam then you might have a point but as this isn't the case I don't see why this is relevant to the question.

      Struan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://282827]
Approved by benn
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-16 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found