Next | Trivial Utilities | 53 |
The heart of mark is two very useful modules and one function:
use Set::IntSpan; use Tie::File;
sub mhc;
Set::IntSpan is for managing strings of the form
20 22-25 30 40-44 55-56 59 62-64 66-73 75-77 79-81 106 108-109
Tie::File lets you treat a file like an array
sub mhc simply runs an MH command
sub mhc { my $cmd = shift; my $result = qx{$cmd}; exit 1 unless defined $result; chomp $result; $result; }
Typical usage:
# Figure out the name of the current folder $folder = mhc "folder -fast";
I could have reimplemented all of MH's folder management machinery in Perl
But it was easier to reuse the MH commands, as was intended
Next | Menu | Copyright © 2012 M. J. Dominus |