Subject: | Module DateTime::Format::ISO8601 generates error after being packaged |
Hi,
I was trying to create a binary file from a script which used
Getopt::Long to enter options and DateTime::Format::ISO8601 to check if
a date existed, and after I ran the pp command to create the binary
file, I couldn't run the binary file, I always got this error :
# ./script
The following parameter was passed in the call to
DateTime::Format::Builder::Parser::create_single_parser but was not
listed in the validation options: params
at DateTime/Format/Builder/Parser.pm line 311
DateTime::Format::Builder::Parser::create_single_parser('undef',
'params', 'ARRAY(0x168b0720)', 'length', 8, 'regex',
'Regexp=SCALAR(0x168b06e0)') called at DateTime/Format/Builder/Parser.pm
line 501
DateTime::Format::Builder::Parser::sort_parsers('DateTime::Format::Build
er::Parser', 'HASH(0x16840ce0)', 'ARRAY(0x1682dd80)') called at
DateTime/Format/Builder/Parser.pm line 397
DateTime::Format::Builder::Parser::create_multiple_parsers('DateTime::Fo
rmat::Builder::Parser', 'HASH(0x16840ce0)', 'HASH(0x168b0700)',
'HASH(0x168b07e0)', 'HASH(0x168b0890)', 'HASH(0x168b0930)',
'HASH(0x168b09e0)', 'HASH(0x168b0b00)', 'HASH(0x168b0c10)', ...) called
at DateTime/Format/Builder/Parser.pm line 600
DateTime::Format::Builder::Parser::create_parser('DateTime::Format::Buil
der::Parser', 'ARRAY(0x167d1ad0)', 'HASH(0x168b0700)',
'HASH(0x168b07e0)', 'HASH(0x168b0890)', 'HASH(0x168b0930)',
'HASH(0x168b09e0)', 'HASH(0x168b0b00)', 'HASH(0x168b0c10)', ...) called
at DateTime/Format/Builder.pm line 156
DateTime::Format::Builder::create_parser('DateTime::Format::Builder',
'ARRAY(0x168c0050)') called at DateTime/Format/Builder.pm line 174
DateTime::Format::Builder::create_end_parser('DateTime::Format::Builder'
, 'ARRAY(0x168c0050)') called at DateTime/Format/Builder.pm line 104
DateTime::Format::Builder::create_class('undef', 'parsers',
'HASH(0x168c35c0)') called at DateTime/Format/ISO8601.pm line 173
require DateTime/Format/ISO8601.pm called at script/script.pl
line 8
main::BEGIN() called at DateTime/Format/ISO8601.pm line 0
eval {...} called at DateTime/Format/ISO8601.pm line 0
require main called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm
line 636
PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x1615f7e0)',
1) called at script/main.pl line 26
require main called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm
line 636
PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x1615f610)')
called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm line 428
PAR::import('PAR') called at -e line 953
eval {...} called at -e line 209
__par_pl::BEGIN() called at DateTime/Format/ISO8601.pm line 0
eval {...} called at DateTime/Format/ISO8601.pm line 0
Compilation failed in require at script/script.pl line 8.
BEGIN failed--compilation aborted at script/script.pl line 8.
I'm working on Perl 5.8.8, with PAR::Packer v1.1013,
DateTime::Format::ISO8601 v0.08, Getopt::Long v2.38 and my operating
system is "Linux XXXXXX.XXXXXXX.XXX 2.6.18-308.el5 #1 SMP Tue Feb 21
20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux" (CentOS).
I've join a script which can be used to reproduce this issue.
Best Regards.
Subject: | script.pl |
#!/usr/bin/perl
# $Id "RFC Call ST03" $
# $Revision: 0 $
# $Source /home/root-hjo/script.pl $
use strict;
use warnings;
use Getopt::Long;
use DateTime::Format::ISO8601;
my ($pstart);
GetOptions("s=i" => \$pstart);
#############################################################################
# MAIN #
#############################################################################
check_input($pstart);
#############################################################################
# FUNCTIONS #
#############################################################################
#################################check_input#################################
sub check_input {
my ($date) = @_;
if (defined($date) == '1') {
eval { my $check = DateTime::Format::ISO8601->parse_datetime($date); };
if ( $@ ) {
die qq{Error : the date doesn't exist or is not like YYYYMMDD\n}
}
else {
print qq{date OK\n};
}
}
else {
print qq{Error while calling script : script.pl -s [YYYYMMDD]\n};
}
}
#############################################################################
__END__