From a337b473e300886319d1b913b0651674b3041ee4 Mon Sep 17 00:00:00 2001 From: Denis Fedoseev Date: Wed, 19 Jul 2017 13:49:54 +0900 Subject: [PATCH] config file --- application.conf.example | 3 +++ fotostore.pl | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 application.conf.example diff --git a/application.conf.example b/application.conf.example new file mode 100644 index 0000000..641690a --- /dev/null +++ b/application.conf.example @@ -0,0 +1,3 @@ +{ + password => '', +} \ No newline at end of file diff --git a/fotostore.pl b/fotostore.pl index c14b51a..a125e81 100644 --- a/fotostore.pl +++ b/fotostore.pl @@ -8,13 +8,13 @@ use File::Basename 'basename'; use File::Path 'mkpath'; use File::Spec 'catfile'; use Cwd; -use Getopt::Long; use Imager; +my $config = plugin 'Config'=> {file => 'application.conf'};; + my $predefined_user = 'alpha6'; -my $predefined_password = ""; -GetOptions('password=s', \$predefined_password); +my $predefined_password = $config->{'password'}; die "No user password defined!" unless($predefined_password);