Net::Fritz::ConfigFile - configuration file handler for Net::Fritz::Box
version v0.0.9
my $config = Net::Fritz::ConfigFile->new( 'some/dir/fritzrc' ); my $config_hashref = $config->configuration;
This class encapsulates the configuration file handling for Net::Fritz::Box. It should not be needed to directly interact with this class. No user-serviceable parts inside!
This class is available since v0.0.9.
v0.0.9
The configuration format is basically a flat text file with key = value per line. Empty lines as well as comments (prefixed by #) are supported.
key = value
#
These keys are recognized:
upnp_url
trdesc_path
username
password
(AppConfig is used to read the configuration file, so some advanced tricks might be possible.)
If the given configuration filename expands to false, these default configuration file locations are tried instead (in order):
$XDG_CONFIG_HOME/fritzrc
$XDG_CONFIG_HOME
~/.config/fritzrc
~/.fritzrc
The first existing file will be used.
Default value: none
Sets a configuration file to read the configuration from.
A ~ at the beginning of the filename will be expanded to $ENV{HOME}.
~
$ENV{HOME}
If the filename expands to false (0, '' or the like), the default configuration file locations will be tried. If none of those files exists, an empty configuration file is substituted.
false
0
''
The configuration values from the configuration file as a hashref.
Keys that were not present in the configuration file are not returned.
Creates a new Net::Fritz::ConfigFile object. Expects parameters in key => value form with the following keys to overwrite the default values:
key => value
"configfile"
With only one parameter (in fact: any odd value of parameters), the first parameter is automatically mapped to "configfile".
See Net::Fritz for general information about this package, especially "INTERFACE" in Net::Fritz for links to the other classes.
Christian Garbs <mitch@cgarbs.de>
Copyright (C) 2017 Christian Garbs
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install Net::Fritz, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Fritz
CPAN shell
perl -MCPAN -e shell install Net::Fritz
For more information on module installation, please visit the detailed CPAN module installation guide.