My natural tendency is to make it less procedural by introducing a couple of new classes that would be data based: User and Message, for instance. And instead of passing around big lists of arguments, we could encapsulate stuff better.
Of course, more classes means less performance -- so it will be good to look for ways to improve performance that will offset the use of the classes.
I realize that I've been passing by value in most of the function calls -- passing by reference would be great, and would presumably reduce the memory footprint of spameater. I was thinking that using prototypes would be a good way to go, but I just got done reading Tom Christansen's article "Far More Than Everything You've Ever Wanted to Know about Prototypes in Perl":
http://www.perl.com/language/misc/fmproto.html
and it's got me pretty freaked out about using them. I guess I'm thinking we can either use the convention:
- Code: Select all
myFunction(\$arg1,\$arg2);
sub myFunction {
my $arg1 = shift;
my $arg2 = shift;
#...
}
or maybe:
- Code: Select all
myFunction($arg1,$arg2);
sub myFunction (\$,\$) {
my $arg1 = shift;
my $arg2 = shift;
#...
}
I've been writing perl for over 10 years, but I must say I still feel like a beginner What do you all think?