The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::Webservice::Common::WithConfigFile - automatically load constructor args from a config file

VERSION

version 1.0.2

SYNOPSIS

  package My::WS::Client {
   use Moo;
   with 'Net::Async::Webservice::Common::WithConfigFile';
   has param => (is => 'ro', required => 1);
  }

  my $c = My::WS::Client->new({config_file=>'/etc/my.conf'});

DESCRIPTION

This role wraps BUILDARGS and, if a config_file argument was passed to the constructor, loads that file with Config::Any and adds the values loaded to the arguments (explicitly passed constructor arguments still take precedence).

SEE ALSO

MooX::ConfigFromFile for a more comprehensive solution.

AUTHOR

Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Net-a-porter.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.