On Fri, 01 Feb 2008, Kevin Beverly wrote:
> i have an active state perl program that parses ms excel files for
> loading into postgresql.
> 
> i use
> 
> use Win32::OLE::Const 'Microsoft Excel';
> use Win32::OLE::Variant;
> 
> to get the dates as text from a spreadsheet. i store the data as an
> array of hashes and write it to disk with storable. everything works
> fine until i try to retrieve the storable file. as soon as it hits that
> date field, perl crashes. it works fine, tho if i format the date fields
> as text.
> 
> obviously, this could be an issue with storable. i sent this issue to
> those folks as well.

You cannot freeze() Win32::OLE::Variant objects because they are implemented
in C and have additional information hanging on to them that Storable knows
nothing about.

This could be made to work for most Variant types by adding special
Storable freeze/thaw hooks to Win32::OLE::Variant (e.g. it would
obviously not work for VT_DISPATCH and VT_OBJECT).  I'll file this
as an enhancement request for Win32::OLE.  For the time being it
would probably be easiest to stringify Win32::OLE::Variant objects
before freezing them.

Cheers,
-Jan

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to