Hostfile::Manager - Manage a hostfile by composing multiple fragments into a whole.
use Hostfile::Manager; $manager = Hostfile::Manager->new; $manager->enable_fragment($fragment_name); $manager->write_hostfile;
Defines the prefix that will be searched for hostfile fragments. Defaults to '/etc/hostfiles/'.
Defines the path to the hostfile to manage. Defaults to '/etc/hosts'.
The contents of the hostfile under management.
The available hostfile fragments.
A list of the names of available fragments.
The contents of an individual hostfile fragment.
Create a new manager instance. Available options are path_prefix and hostfile_path, listed in the ACCESSORS section.
Write the contents of the hostfile to disk.
Test whether a named fragment is enabled in the hostfile under management.
Enable a named fragment. If the fragment is currently enabled, it will be disabled first, removing any modifications that may have been made out-of-band.
Disable a named fragment.
Enable a fragment if it is disabled, disable it otherwise.
Returns a string indicating the current status of a named fragment.
Copyright (c) 2010-11 Anthony J. Mirabella. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Anthony J. Mirabella <mirabeaj AT gmail DOT com>