in reply to Log rotator in perl

Monks please help me.This is my code

#!/usr/bin/perl -w use Log::Dispatch::FileRotate; # my $file = Log::Dispatch::FileRotate->new( name => 'file1', # min_level => 'info', # filename => 'ree.log', # mode => 'append', # size => 1000, # max => 5, # ); # $file->log( level => 'info', message => "Module Testing\n");

This is the error I get

C:\Users\hpai\Desktop\perlcoading>perl -d one.pl Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. Signal SEGV at C:/Perl/site/lib/Params/Validate/XS.pm line 42. require Params/Validate/XS.pm called at C:/Perl/lib/Module/Run +time.pm li ne 317 Module::Runtime::require_module('Params::Validate::XS') called + at C:/Per l/site/lib/Module/Implementation.pm line 85 Module::Implementation::__ANON__[C:/Perl/site/lib/Module/Imple +mentation. pm:87]() called at C:/Perl/lib/Try/Tiny.pm line 76 eval {...} called at C:/Perl/lib/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x2104394)', 'Try::Tiny::Catch=REF(0x20f4 +ac4)') cal led at C:/Perl/site/lib/Module/Implementation.pm line 90 Module::Implementation::_load_implementation('Params::Validate +', undef, 'ARRAY(0x20f4964)') called at C:/Perl/site/lib/Module/Implementation.p +m line 33 Module::Implementation::__ANON__[C:/Perl/site/lib/Module/Imple +mentation. pm:44]() called at C:/Perl/site/lib/Params/Validate.pm line 66 require Params/Validate.pm called at C:/Perl/site/lib/Log/Disp +atch.pm li ne 13 Log::Dispatch::BEGIN() called at C:/Perl/site/lib/Params/Valid +ate/XS.pm line 0 eval {...} called at C:/Perl/site/lib/Params/Validate/XS.pm li +ne 0 require Log/Dispatch.pm called at C:/Perl/site/lib/Log/Dispatc +h/Output.p m line 9 Log::Dispatch::Output::BEGIN() called at C:/Perl/site/lib/Para +ms/Validat e/XS.pm line 0 eval {...} called at C:/Perl/site/lib/Params/Validate/XS.pm li +ne 0 require Log/Dispatch/Output.pm called at C:/Perl/site/lib/Log/ +Dispatch/F ileRotate.pm line 6 Log::Dispatch::FileRotate::BEGIN() called at C:/Perl/site/lib/ +Params/Val idate/XS.pm line 0 eval {...} called at C:/Perl/site/lib/Params/Validate/XS.pm li +ne 0 require Log/Dispatch/FileRotate.pm called at one.pl line 2 main::BEGIN() called at C:/Perl/site/lib/Params/Validate/XS.pm + line 0 eval {...} called at C:/Perl/site/lib/Params/Validate/XS.pm li +ne 0

Replies are listed 'Best First'.
Re^2: Log rotator in perl
by Corion (Patriarch) on Oct 30, 2013 at 13:54 UTC
    Signal SEGV at C:/Perl/site/lib/Params/Validate/XS.pm ...

    This means that you got an access violation while trying to load/run code that uses Params::Validate. How did you install Params::Validate on the target machine? Note that PPMs compiled for one version of Perl do not work on a different version of Perl.

    A quick way to further eliminate other modules coming into play is to look at whether Params::Validate can load on its own:

    perl -MParams::Validate -e "print 'ok'"

    If that code prints ok, then you have a larger problem as you need to find the real root cause. If the above command line snippet crashes, then at least your installation of Params::Validate is broken and you need to review the installation process you used for the module.