Skip to content

Instantly share code, notes, and snippets.

@Pablo-Leon
Created January 2, 2017 21:10
Show Gist options
  • Save Pablo-Leon/c910d9329805e42d3e87c1eba0ade29f to your computer and use it in GitHub Desktop.
Save Pablo-Leon/c910d9329805e42d3e87c1eba0ade29f to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
=head1 Copyright ...
=head1 NOMBRE
starter.pl -
=head1 SINOPSIS
starter.pl [switches]
--help Obtener ayuda
--event_name=<name>
Event Name
--debug Mostrar mensajes de debug (STDERR)
--trace Guardar mensajes de debug en starter.pl.trc
=head1 DESCRIPCION
=cut
use strict;
use warnings;
use English;
use Data::Dumper;
use Getopt::Long ();
use Encode qw(decode encode encode_utf8);
use utf8;
use Log::Log4perl qw(:easy);
# use Log::Log4perl qw(get_logger :levels);
use Time::HiRes;
sub help () {
my ($pack, $file, $line)=caller();
system('perldoc -t '.$file);
exit 1;
}
my ($program)=$0; $program=~s/^.*\/([^\/]+)$/$1/;
#
# Recibir parametros
#
my $optctl = {};
Getopt::Long::GetOptions($optctl,
'--help'
,'--debug'
,'--trace'
) || help();
if ( defined $optctl->{'help'} ) {
help();
}
Log::Log4perl->easy_init({
level => $DEBUG
,file => ">${program}.log"
,layout => "%d{HH:mm} +%R %p %M[%L] %m%n"
} );
#
# Init
#
$|=1; # $OUTPUT_AUTOFLUSH=1
my ($rc);
#
# Params
#
DEBUG("optctl: %s", Dumper($optctl));
#
# Init
#
#
# Body
#
while(<>)
{
print;
}
exit;
###############################################################################
sub Funcion
{
my ($sParam1, $sParam2)=@_;
my $ret='';
DEBUG("Funcion( %s )", join(' ', map( (defined($_)?"[$_]":'<undef>'), @_)));
# Cuerpo de Funcion
DEBUG("MakeUrlBelinHb()->[%s]", $ret);
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment