Mail::Box::MH::Resource - Manage an MH resource file such as the MH profile


Mail-Box-MH-Resource documentation  | view source Contained in the Mail-Box-MH-Resource distribution.

Index


NAME

Top

Mail::Box::MH::Resource - Manage an MH resource file such as the MH profile

SYNOPSIS

Top

  #Create object and load profile
  my $prof = Mail::Box::MH::Resource->new();

  #Get a list of the profile components
  my @keys = $prof->enum();

  #Get MH directory to pass to Mail::Box::Manager
  my $folderdir = $prof->get('Path');
  $folderdir = File::Spec->file_name_is_absolute($folderdir->{Path}) ?
                                                 $folderdir->{Path}  :
                 File::Spec->catfile($ENV{HOME}, $folderdir->{Path})

  #Permanently remove messages
  $prof->set('rmmproc'=>'rm');

  #Save changes
  $prof->close();

DESCRIPTION

Top

Read and write MH format resource files such as profile, context, and sequence.

METHODS

Top

new [FILENAME]

Open a resource file, accepts an optional filename of the resource file to open. Non-absolute filenames which do not start with your system's designation for the current directory are opened relative to the MH profile Path component. ./ should work on most right minded systems, : for Macintosh, see File::Spec if you don't what it is for your system. If unspecified new falls back to $ENV{MH} and then $HOME/.mh_profile.

Example:

  #Create a new profile
  my $prof = Mail::Box::MH::Resource->new('/tmp/.mh_profile');

  #Load the context file to determine the currently selected folder
  my $cntx = Mail::Box::MH::Resource->new('current');

enum

Returns a list of existing component names.

get COMPONENT [COMPONENTS]

Return the values of one or more components. See SYNOPSIS for an example.

set COMPONENT [COMPONENTS]

Set the values of one or more components. See SYNOPSIS for an example.

close

Write the resource file to disk, original component ordering is not preserved.

CAVEATS

Top

Order is not preserved therefore "comments" may end up misplaced.

SEE ALSO

Top

mh-profile(5), Mail::Box::MH.

AUTHOR

Top

Jerrad Pierce <jpierce@cpan.org>


Mail-Box-MH-Resource documentation  | view source Contained in the Mail-Box-MH-Resource distribution.