NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
long sub names (Score:1)
I can imagine using that sub, but it should apparently be broken into two subs, at least,
if it's doing two things (delivering emails, delivering section types).
deliver_emails_for_products would be a wrapper around deliver_emails,
if it's delivering separate emails for several products (maybe I misunderstand it).
deliver_section_types_for_users_that_havent_received_email
would wrap around deliver_section_types:
sub deliver_section_types_for_users_that_havent_received_email {
my $users = get_users_that_havent_received_email();
deliver_section_types($users);
}
sub get_users_that_havent_received_email {
# depends on the problem, might be broken down further
}
I personally like code that is factored out like that,
even with long sub names.
I can see from your previous post, though, that the code inside is probably hideous
in your case.
Reply to This
Re: (Score:1)
That sub has fourteen positional arguments.
Re: (Score:1)
“If you have a procedure with 10 parameters, you probably missed some.” —Alan J. Perlis, Epigrams on Programming