GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Config::MySQL::Reader(3) User Contributed Perl Documentation Config::MySQL::Reader(3)

Config::MySQL::Reader - Read MySQL-style configuration files

Version 0.01

If my.cnf contains

    [mysqld]
    datadir=/var/lib/mysql
    skip-locking

    [mysqldump]
    quick
    max_allowed_packet = 16M

    !include /etc/my_other.cnf
    !include /etc/my_extra.cnf

Then when your program contains

    my $config = Config::MySQL::Reader->read_file('my.cnf');

$config will contain

    {
        '_' => {
            '!include' => [
                '/etc/my_other.cnf',
                '/etc/my_extra.cnf',
            ],
        },
        'mysqld' => {
            'datadir'      => '/var/lib/mysql',
            'skip-locking' => undef,
        },
        'mysqldump' => {
            'quick'              => undef,
            'max_allowed_packet' => '16M',
        },
    }

This module extends Config::INI::Reader to support reading MySQL-style configuration files. Although deceptively similar to standard ".INI" files, they can include bare boolean options with no value assignment and additional features like "!include" and "!includedir".

"Config::MySQL::Reader" does not read files included by the "!include" and "!includedir" directives, but does preserve the directives so that you can safely read, modify, and re-write configuration files without losing them. If you need to read the contents of included files, you may want to look at Config::Extend::MySQL which handles this automatically (but does not handle roundtripping).

See "METHODS FOR READING CONFIG" in Config::INI::Reader for usage details.

Copes with MySQL-style boolean properties that have no value assignment.

Handle "!include" and "!includedir" directives. Comments can start with hash too.

Strip inline comments (starting with ; or #)

Config::INI
MySQL::Config
Config::Extend::MySQL

Iain Arnell, "<iarnell at gmail.com>"

Please report any bugs or feature requests to "bug-config-ini-mysql at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Config-MySQL>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.

    perldoc Config::MySQL::Reader

You can also look for information at:

  • RT: CPAN's request tracker

    <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-MySQL>

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/Config-MySQL>

  • CPAN Ratings

    <http://cpanratings.perl.org/d/Config-MySQL>

  • Search CPAN

    <http://search.cpan.org/dist/Config-MySQL/>

Thanks to Ricardo Signes for Config-INI.

Copyright 2010 Iain Arnell.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

2010-04-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.