#!/usr/bin/perl use common::sense; use lib qw(../lib lib); use Getopt::Std; use FindBin qw/$Bin/; use YAML; ++$|; $0 =~ s{.*/}{}; $ENV{PATH} = '/bin:/usr/bin:/sbin:/usr/sbin'; (my $cfg_file_default = "$Bin/$0.yml") =~ s/\.pl//; my %opts = (); getopts('c:d', \%opts); my $cfg_file = $opts{c} && length($opts{c}) ? $opts{c} : $cfg_file_default; my $debug = $opts{d}; die "Usage: $0 [-d] [-c config.yml]\n" unless -r $cfg_file; my $config = YAML::LoadFile($cfg_file); umask 022;
Также в последнее время очень понравился JSON::XS для сериализации данных. Очень быстро работает.
Комментариев нет:
Отправить комментарий