The Perl Advent Calendar needs more articles for 2022. Submit your idea today!


Net::Fritz::Box - main configuration and entry point for Net::Fritz distribution


version v0.0.9


    my $fritz = Net::Fritz::Box->new();

    my $fritz_nossl = Net::Fritz::Box->new(
        upnp_url => ''

    my $fritz_auth = Net::Fritz::Box->new(
        username => 'admin',
        password => 's3cr3t'


This class the global configuration state and provides discovery of Net::Fritz::Devices.

ATTRIBUTES (read-only, defaults can be changed)


Default value:

Base URL for all operations. This must point to your device. The default value expects a standard Fritz!Box installation with working local DNS.

If you can't do DNS lookups for your router, use an IP address instead.

If you have a Fritz!Box and don't know its IP, you can try or, these adresses seem to be hardcoded for "emergency use" after a misconfiguration.

An address starting with https:// enables secure communication over SSL. To disable SSL, use an address starting with http://. The port will be different; the Fritz!Box default for unsecured access is


Default value: /tr64desc.xml

The path below "upnp_url" from where the TR064 service description is fetched. There should be no need to change the default.


Default value: none

Sets the username to use for authentication against a device.


Default value: none

Sets the password to use for authentication against a device.


Default value: none

Sets a configuration file to read the configuration from.

For a description of the file format as well as default configfile locations that are automatically searched, see Net::Fritz::ConfigFile.

If an attribute is both defined by the configuration file and given as a parameter to "new", the parameter overwrites the value from the configuration file.

This attribute is available since v0.0.8.


See "error" in Net::Fritz::IsNoError.



Creates a new Net::Fritz::Box object. This is propably the first thing to do when using Net::Fritz. Expects parameters in key => value form with the following keys to overwrite the default values:


Tries to discover the TR064 device at the current "upnp_url". Returns a Net::Fritz::Device on success. Accepts no parameters.

call(service_name action_name [argument_hash])

Directly calls the Net::Fritz::Action named action_name of the Net::Fritz::Service matching the regular expression service_name.

This is a convenience method that internally calls "discover" followed by Net::Fritz::Device::call - see those methods for further details.

The intermediate Net::Fritz::Device is cached, so that further calls can skip that initial SOAP request.

This method is available since v0.0.8.


Returns some preformatted multiline information about the object. Useful for debugging purposes, printing or logging. The optional parameter indent is used for indentation of the output by prepending it to every line.


See "errorcheck" in Net::Fritz::IsNoError.


See Net::Fritz for general information about this package, especially "INTERFACE" in Net::Fritz for links to the other classes.


Christian Garbs <>


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 <>.