Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl Serialization + Moose Object. Will the code get serialized?

by choroba (Cardinal)
on May 24, 2015 at 14:49 UTC ( [id://1127594]=note: print w/replies, xml ) Need Help??


in reply to [Solved] : Perl Serialization + Moose Object. Will the code get serialized?

The code is not retrieved from the dump, it exists because you loaded the class. I created a new script which doesn't use MooseClass:
#serialize.pl use strict; use warnings; use Storable; use Data::Dumper; my $no_class = retrieve('serialize.bin'); print Dumper $no_class; $no_class->increaseAge();

The output shows what was retrieved and what was missing:

$VAR1 = bless( { 'age' => 23, 'gender' => 'girl', 'name' => 'Eva' }, 'MooseClass' ); Can't locate object method "increaseAge" via package "MooseClass" at 1 +.pl line 46.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Perl Serialization + Moose Object. Will the code get serialized?
by sam_bakki (Pilgrim) on May 25, 2015 at 04:20 UTC

    Hi choroba

    Thanks for the clarification :). So looks like the "bless" information alone is serialized. So when deserialized , if the class is already loaded, it can work. I will mark this thread as solved.

    Thanks & Regards,
    Bakkiaraj M
    My Perl Gtk2 technology demo project - http://code.google.com/p/saaral-soft-search-spider/ , contributions are welcome.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-18 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found