#!/usr/bin/perl -w use strict; use Getopt::Long; use Log::Log4perl qw(:easy); use ABC::Parser; use vars qw($debug); GetOptions( "debug|x" => \$debug, "help|h" => \&usage, ); ##Initializations Log::Log4perl::init( "../conf/log4perl.conf" ); my $logger = Log::Log4perl::get_logger(); my $data = ABC::Parser::get_data({file => "/tmp/test.data"}); $logger->error("could not get parsed data") if(!$data); $logger->info("Created output"); $logger->debug("$data") if ($debug); sub get_log{ use File::Basename; use POSIX qw(strftime); my $now_string = strftime("%Y-%m-%d", localtime); my $log = sprintf "%s.$now_string.info.log", basename( $0, '.pl' ); return $log; } __END__