|
List Info
Thread: Perlapp and DateTime parsers - NOT!?!?
|
|
| Perlapp and DateTime parsers - NOT!?!? |

|
2006-12-08 15:22:03 |
Hi,
I've spent a day racking my brain trying to use the DateTime
package
in a perlapp'ed script. Actually, the following absolutely
minimal
script is enough to make things go awry:
# foo.pl
# compile using: 'perlapp --add DateTime::Locale::en foo.pl'
use DateTime::Format::ISO8601;
__END__
The --add is not enough actually, but enough to illustrate
this, and
further, there is no list of --add that can salvage the
situation it
appears to me :-(
BTW, this is using PDK 6.0.2, Build 819 on WinXP (plus some
CPAN work
to get the appropriate DateTime: stuff set
up).
Trying to run the exe produces this:
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 /PerlApp/DateTime/Format/Builder/Parser.pm line 299
DateTime::Format::Builder::Parser::create_single_parser('un
def',
'params', 'ARRAY(0xfd6da4)', 'length', 8, 'regex',
'Regexp=SCALAR(0xfd6d98)') called at
/PerlApp/DateTime/Format/Builder/Parser.pm line 484
DateTime::Format::Builder::Parser::sort_parsers('DateTime::
Format::Builder::Parser', 'HASH(0xf93eac)',
'ARRAY(0xf83734)') called at
/PerlApp/DateTime/Format/Builder/Parser.pm line
385
DateTime::Format::Builder::Parser::create_multiple_parsers(
'DateTime::Format::Builder::Parser', 'HASH(0xf93eac)',
'HASH(0xfd6de0)', 'HASH(0xfd6e70)', 'HASH(0xfd6ef4)',
'HASH(0xfd6f6c)', 'HASH(0xfd18c4)', 'HASH(0xfd199c)',
'HASH(0xfd1a68)', ...) called at
/PerlApp/DateTime/Format/Builder/Parser.pm line
583
DateTime::Format::Builder::Parser::create_parser('DateTime:
:Format::Builder::Parser', 'ARRAY(0xf710a4)',
'HASH(0xfd6de0)', 'HASH(0xfd6e70)', 'HASH(0xfd6ef4)',
'HASH(0xfd6f6c)', 'HASH(0xfd18c4)', 'HASH(0xfd199c)',
'HASH(0xfd1a68)', ...) called at
/PerlApp/DateTime/Format/Builder.pm line
156
DateTime::Format::Builder::create_parser('DateTime::Format:
:Builder',
'ARRAY(0xfe95dc)') called at
/PerlApp/DateTime/Format/Builder.pm line
174
DateTime::Format::Builder::create_end_parser('DateTime::For
mat::Builder',
'ARRAY(0xfe95dc)') called at
/PerlApp/DateTime/Format/Builder.pm line
104
DateTime::Format::Builder::create_class('undef', 'parsers',
'HASH(0xfed808)') called at
/PerlApp/DateTime/Format/ISO8601.pm line 175
eval '' called at perlapp.pl line 1361
PerlApp::safe_eval() called at perlapp.pl line 1451
PerlApp::my_require('DateTime/Format/ISO8601.pm') called at
foo.pl line 2
main::BEGIN() called at /PerlApp/DateTime/Format/ISO8601.pm
line 0
eval {...} called at /PerlApp/DateTime/Format/ISO8601.pm
line 0
BEGIN failed--compilation aborted at foo.pl line 2.
Looks daunting, but figuring it was just a matter of missing
--add
stuff required I set to work discovering what it might be...
Turns out that no, the 'pluggable' parsers in
DateTime::Format::Builder::Parser: is not
getting loaded. However,
after inspecting DateTime::Format::Builder::Parser (.pm),
they are
loaded dynamically after discovering them using
Class::Factory::Util...and this is done purely diskbased
from looking
at INC, and this technique won't work in Perlapp if I
understand
correctly. Actually, if I put stuff on disk alongside the
exe, the
code will find it. Not really comfy with this...maybe I
could bind the
required stuff in the exe, extract it and it will magically
work...will test that. Still, seems like a messy
workaround...
Any thoughts on this, or any clever trick I have overlooked?
TIA,
ken1
_______________________________________________
PDK mailing list
PDK listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
| Perlapp and DateTime parsers - NOT!?!? |

|
2006-12-08 15:59:51 |
At 10:22 AM 12/8/2006, kenneth olwing.se wrote:
>Hi,
>
>I've spent a day racking my brain trying to use the
DateTime package
>in a perlapp'ed script. Actually, the following
absolutely minimal
>script is enough to make things go awry:
So you have worked out what the issue is when I read to the
end.
Similar situations exist with PDF::API2 and Class: BI. All
you need
to do is work out what is needed and then you can bind them
to the
exe in the same way. PerlApp is very good at resolving
dependencies,
but not infallible.
># foo.pl
># compile using: 'perlapp --add DateTime::Locale::en
foo.pl'
>use DateTime::Format::ISO8601;
>__END__
>
>The --add is not enough actually, but enough to
illustrate this, and
>further, there is no list of --add that can salvage the
situation it
>appears to me :-(
Well you must have worked out what was necessary when you
said
further down that you moved some files into the directory
and it all
worked. Just bind those same files into the exe. Then you
WILL have
salvaged the situation.
No clever trick, but dynamic loading of plug-ins does cause
issues.
John
>BTW, this is using PDK 6.0.2, Build 819 on WinXP (plus
some CPAN work
>to get the appropriate DateTime: stuff set
up).
>
>Trying to run the exe produces this:
>
>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 /PerlApp/DateTime/Format/Builder/Parser.pm line
299
>
DateTime::Format::Builder::Parser::create_single_parser('und
ef',
>'params', 'ARRAY(0xfd6da4)', 'length', 8, 'regex',
>'Regexp=SCALAR(0xfd6d98)') called at
>/PerlApp/DateTime/Format/Builder/Parser.pm line 484
>
>DateTime::Format::Builder::Parser::sort_parsers('DateTim
e::Format::Builder::Parser',
>'HASH(0xf93eac)', 'ARRAY(0xf83734)') called at
>/PerlApp/DateTime/Format/Builder/Parser.pm line
>385
>
>DateTime::Format::Builder::Parser::create_multiple_parse
rs('DateTime::Format::Builder::Parser',
>'HASH(0xf93eac)', 'HASH(0xfd6de0)', 'HASH(0xfd6e70)',
>'HASH(0xfd6ef4)', 'HASH(0xfd6f6c)', 'HASH(0xfd18c4)',
>'HASH(0xfd199c)', 'HASH(0xfd1a68)', ...) called at
>/PerlApp/DateTime/Format/Builder/Parser.pm line
>583
>
>DateTime::Format::Builder::Parser::create_parser('DateTi
me::Format::Builder::Parser',
>'ARRAY(0xf710a4)', 'HASH(0xfd6de0)', 'HASH(0xfd6e70)',
>'HASH(0xfd6ef4)', 'HASH(0xfd6f6c)', 'HASH(0xfd18c4)',
>'HASH(0xfd199c)', 'HASH(0xfd1a68)', ...) called at
>/PerlApp/DateTime/Format/Builder.pm line
>156
>
>DateTime::Format::Builder::create_parser('DateTime::Form
at::Builder',
>'ARRAY(0xfe95dc)') called at
/PerlApp/DateTime/Format/Builder.pm line
>174
>
>DateTime::Format::Builder::create_end_parser('DateTime::
Format::Builder',
>'ARRAY(0xfe95dc)') called at
/PerlApp/DateTime/Format/Builder.pm line
>104
>
DateTime::Format::Builder::create_class('undef', 'parsers',
>'HASH(0xfed808)') called at
/PerlApp/DateTime/Format/ISO8601.pm line 175
> eval '' called at perlapp.pl line 1361
> PerlApp::safe_eval() called at perlapp.pl line
1451
>
PerlApp::my_require('DateTime/Format/ISO8601.pm') called at
> foo.pl line 2
> main::BEGIN() called at
/PerlApp/DateTime/Format/ISO8601.pm line 0
> eval {...} called at
/PerlApp/DateTime/Format/ISO8601.pm line 0
>BEGIN failed--compilation aborted at foo.pl line 2.
>
>Looks daunting, but figuring it was just a matter of
missing --add
>stuff required I set to work discovering what it might
be...
>
>Turns out that no, the 'pluggable' parsers in
>DateTime::Format::Builder::Parser: is not
getting loaded. However,
>after inspecting DateTime::Format::Builder::Parser
(.pm), they are
>loaded dynamically after discovering them using
>Class::Factory::Util...and this is done purely diskbased
from looking
>at INC, and this technique won't work in Perlapp if I
understand
>correctly. Actually, if I put stuff on disk alongside
the exe, the
>code will find it. Not really comfy with this...maybe I
could bind the
>required stuff in the exe, extract it and it will
magically
>work...will test that. Still, seems like a messy
workaround...
>
>Any thoughts on this, or any clever trick I have
overlooked?
>
>TIA,
>
>ken1
>
>_______________________________________________
>PDK mailing list
>PDK listserv.ActiveState.com
>To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
_______________________________________________
PDK mailing list
PDK listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|
|
[1-2]
|
|