So, if you ever get sick and subscribe to lots of feeds automatically through rss2email, you know that you end up with lots of unprocessed email, like maybe a hundred episodes or something. And maybe all those emails arrive base64, and maybe you want to archive each show's mp3 version. What you could do is keep opening email in mutt or something and cutting and paste'ing until your fingers fall off (mouse, keyboard, mouse, keyboard, ad pukeum).

Or you could write some perl:
use MIME::Base64; my $action = shift; my %block = ( email => '/ \< ($s) \> /xi and print $1 . "\n"', url => '/href \s* = \s* (?:\'|\") ($s) (?:\'|\") /xi and print $1 . "\n"', base64 => 'print decode_base64($_)', ); my %re = ( email => qr/ \S \@ \S /x, url => qr/ (?:ht|f)tp:\/\/\S+ /x, ); my $s = $re{$action}; map { eval($block{$action}) } <>;

Basically, we just made life easier by being able to peer into things from a shell perspective with some pre-canned regexps and transforms, like:

cat .maildir/todo/cur/* | filter base64 | filter url | grep mp3 | xargs -i wget {}

Granted, this is still line-oriented, so maybe I'll see what the impact of moving to a multi-line parser would be....

What other good pre-canned regexps are there? I know the above are incomplete. I looked into Regexp::Common, but that needs some love and some more regexps, like email.