Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Parse::PlainConfig 2.06

    Download button

    No screenshots available
    Downloads: 206  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Arthur Corliss | More programs
    Perl Artistic License / FREE
    June 21st, 2010, 19:55 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Parse::PlainConfig description

    Parser for plain-text configuration files

    Parse::PlainConfig is a Perl module that provides OO objects which can parse and generate human-readable configuration files.

    SYNOPSIS

     use Parse::PlainConfig;

     $conf = new Parse::PlainConfig;
     $conf = Parse::PlainConfig->new(
     'PARAM_DELIM' => '=',
     'FILE' => '.myrc',
     'MAX_BYTES' => 65536,
     'SMART_PARSER => 1,
     );

     $conf->property(PARAM_DELIM => '=');

     $rv = $conf->read('myconf.conf');
     $rv = $conf->read;
     $rv = $conf->readIfNewer;
     $conf->write('.myrc', 2);

     $conf->purge;

     @parameters = $conf->parameters;
     $conf->parameter(FOO => "bar");
     $value = $conf->parameter(FOO);
     $conf->describe(FOO => 'This is foo');
     $conf->coerce("string", qw(FOO BAR));

     @order = $conf->order;
     $conf->order(@new_order);

     $errstr = Parse::PlainConfig::ERROR;

     $rv = $conf->hasParameter('FOO');


    The following methods are only supported for backwards compatibility reasons. They will likely be removed at some point in the future.

     # Use of the tags DELIM and PURGE are deprecated in favour of
     # PARAM_DELIM, LIST_DELIM, HASH_DELIM, and AUTOPURGE
     $conf = Parse::PlainConfig->new(
     'DELIM' => '=',
     'PURGE' => 1,
     );

     # As is the delim method since it works only on the tag delimiter
     $conf->delim('=');

     # Auto-purge should be enabled/disabled via the property method
     $conf->purge(1);

     # directives is replaced with parameters
     @directives = $conf->directives;

     # get/set methods are replaced with a unifed parameter method
     $field = $conf->get('KEY1');
     ($field1, $field2) = $conf->get(qw(KEY1 KEY2));
     $conf->set(KEY1 => 'foo', KEY2 => 'bar');

     # This was just a really bad idea to begin with, plus it's
     # effective broken at this point (only returns a copy of the
     # internal hash now, so it's effectively read-only)
     $hashref = $conf->getRef;

     # This is just a wrapper for the class function
     $errstr = $conf->error



    Product's homepage

    Requirements:

    · Perl
    · Paranoid
    · Text::ParseWords
    · Text::Tabs

      


    TAGS:

    configuration files | configuration parser | Perl module | configuration | parser | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM