[sf-perl] Perl Programmer position in Palo Alto

Fred Moyer fred at redhotpenguin.com
Wed Apr 4 11:42:06 PDT 2007


On Wed, 4 Apr 2007 1:17 am, Greger wrote:
> On Tue, 3 Apr 2007 23:00:22 -0700, Quinn Weaver wrote
>>  On Tue, Apr 03, 2007 at 09:03:33PM -0700, Fred Moyer wrote:
>>  > Seems like the job of adding [job] to the prefix of the Subject line
>>  > would be a great task for a perl program :)  Are there any hooks 
>> into
>>  > the list software?
>>  >
>>  > $subject = sprintf("[job] %s", $subject) if $body =~ m/(?:job)/i;
>>
>>  Good idea.  Also a good excuse to learn Python (which Mailman is
>>  written in).
>>
>>  Anyone want to send me a diff? ;)
> ah, the above will trigger a false positive with "duuh, what a job this 
> perl
> is..."*S*
> hehe...

Right... Which is why I said 'or something more clever'  :)  Like;

my @body_terms = split(" ", $body);
local $" = '|'; # change the quoting operator to |
my @job_terms = qw( job hire salary position );
my $subject_trigger = grep { $_ =~ m/@job_terms/i } @body_terms;
add_subject if ($subject_trigger > int(scalar(job_terms)/2));

Not perfect, but I think you can get pretty close with a few revisions.

Now, anyone want to plug this into mailman?  :)


More information about the SanFrancisco-pm mailing list