Re: use sys::virt module to manage VM in kvm

2014-03-28 Thread Andy Bach
On Fri, Mar 28, 2014 at 3:05 PM, Dr.Ruud wrote: > if ($@) { >> die "$@"; >> } >> > > Never test $@, only use the value of $@ after a failed eval. > Why not? The perldoc eval shows: If the code to be executed doesn't vary, you may use the eval-BLOCK form to trap run-time erro

Re: Log4Perl query

2014-03-28 Thread Andy Bach
On Fri, Mar 28, 2014 at 8:01 AM, punit jain wrote: > Attempt to bless into a reference at > /root/scripts/bin/../lib/Log/Log4perl/Logger.pm line 143. > Not really but: Why "Log::Log4perl->get_logger" and not "Log::Log4perl->new"? We don't want to create a new object every time. Usually in

Re: use sys::virt module to manage VM in kvm

2014-03-28 Thread Dr.Ruud
On 2014-03-27 20:53, Natxo Asenjo wrote: use strict; use warnings; use utf8; That "use utf8;" is almost always wrong, see 'perldoc utf8', only use it if your source code is utf8 encoded. if ($@) { die "$@"; } Never test $@, only use the value of $@ after a failed eval. -- Ruud

Re: use sys::virt module to manage VM in kvm

2014-03-28 Thread lesleyb
On Thu, Mar 27, 2014 at 01:41:53PM -0400, PJ wrote: > I’m new to perl too…but do they have a concept of abstract classes in perl? > On Mar 27, 2014, at 3:27 AM, lesleyb wrote: > > > On Wed, Mar 26, 2014 at 06:43:47PM -0700, Jim Gibson wrote: > >> > >> On Mar 26, 2014, at 6:30 PM, Benjamin Fernan

Log4Perl query

2014-03-28 Thread punit jain
Hi, I have a requirement where I need different appenders writing to same log file for different layout patterns. Below is my log4Perl config file :- log4perl.logger.timestamp = INFO, LOG1 log4perl.appender.LOG1 = Log::Log4perl::Appender::File log4perl.appender.LOG1.filename

padding values depending on a list

2014-03-28 Thread Luca Ferrari
Hi all, I've a problem that has to presents data into an array in a set of string with a variable left/right padding depending on the field position in the arrat. Therefore I'm building a very long printf format string to be used as: print @array; What I don't like in this solution is that the