Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Storable under Win XP?

by FrankHaas (Initiate)
on Jan 08, 2008 at 15:14 UTC ( [id://661103]=perlquestion: print w/replies, xml ) Need Help??

FrankHaas has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,

I'm trying to use Storable under Win XP with ActiveState Perl 5.8.8. I'm getting an error which says:

D:\Frank\tdump>perl p1.pl Cannot restore overloading on SCALAR(0x1c0d3b0) (package PDL) (even af +ter a "require PDL;") at ..\..\lib\Storable.pm (autosplit into ..\..\ +lib\auto\Storable\_retrieve.al) line 380, at p1access.pm line 53

I've reinstalled PDL 2.4.3 but that didn't help. My user code where it fails is this function:

sub my_retrieve { my $File = $_[0]; my $arrayref = retrieve("$File"); return @{$arrayref}; }

What am I doing wrong here?

Thanks in advance!

Regards

Frank

Replies are listed 'Best First'.
Re: Storable under Win XP?
by Corion (Patriarch) on Jan 08, 2008 at 15:23 UTC

    I'm not sure whether you can store any PDL object via Storable at all - PDL has many parts written in XS (that is, C), which are invisible to Storable, and unless the PDL modules implement the appropriate Storable hooks, those C parts will remain invisible to Storable.

    But then, I've never used PDL and not much of Storable, so it might be that the two are supposed to work together.

    A different approach might be to use Data::Dumper instead, but that one will make the size of your data grow very large while dumping it.

      Thanks,

      just realized I wasn't clear enough - I don't want to use PDL, just Storable but it looks as if Storable requires PDL, i.e. when I remove PDL and try it again I'm getting:

      D:\Frank\tdump>perl p1.pl Can't locate PDL.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/l +ib .) at ..\..\lib\Storable.pm (autosplit into ..\..\lib\auto\Storabl +e\_retrieve.al) line 380. BEGIN failed--compilation aborted, at p1access.pm line 60

      Thanks again!

      Regards

      Frank

        No... I think the file you're trying to load using Storable requires PDL. Storable works fine without PDL all by itself.

        Try to save a data structure you created yourself, first, and load that.

Re: Storable under Win XP?
by moklevat (Priest) on Jan 08, 2008 at 16:04 UTC
    There are a couple of modules designed to help with this, but unfortunately neither seems to be available as a ppm for ActiveState under Win32 (assuming you are using ActiveState).

    Both PDL::IO::Storable and PDL::NetCDF could help accomplish your aims. Though according to the docs for PDL::IO::Storable, if you plan to use the stored piddles across platforms, you may be better off using PDL::NetCDF. Initially, it looked like an ActivePerl ppm for PDL::NetCDF was available from Randy Kobe's ppm repository, but the link to NetCDF on that page goes nowhere. From Trouchelle it looks like the 0.93 build failed.

    So, I guess this is helpful only if you can build your own.

      Would using CPAN on Windows help out any there?

      I had forgotten, but you can use "perl -MCPAN -e shell" on Windows and add/configure modules.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://661103]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found