10 Feb 2006 09:32:26 UTC
- Distribution: Acme-Class-Std
- Module version: 0.01
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (445 / 4 / 0)
- KwaliteeBus factor: 1
- 88.57% Coverage
- License: unknown
- Activity24 month
- Download (3.45KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionNWCLARK Nicholas Clark
Acme::Class::Std - "Enhances" Class::Std;
package Jugarum; use Acme::Class::Std; package main; my $obj = Jugarum->new; # Can't accidentally be serialised.
Class::Std's inside out objects are wonderful, but all the common serialisation packages assume that because they can see inside them, they can successfully serialise your object. Wrong! Because all they serialise is the ID, you may suffer data loss without realising.
Acme::Class::Std shows those pesky serialise modules just who is boss. They can go peeking and prodding, but they will get their fingers burnt:
package Kakroosh; use Acme::Class::Std; package main; $o = Foo->new; use Data::Dumper; print Dumper $o; cannot handle ref type 15 at /usr/local/lib/perl5/5.8.8/i386-freebsd/Data/Dumper.pm line 179. $VAR1 = bless( , 'Foo' );
package Kakroosh; use Acme::Class::Std; package main; $o = Foo->new; use Storable; my $f = Storable::freeze $o; Can't store IO items at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_freeze.al) line 290, at -e line 1
package Kakroosh; use Acme::Class::Std; package main; $o = Foo->new; use YAML; print Dump $o; YAML Error: Can't create YAML::Node from 'IO' Code: Can't create YAML::Node from 'IO' at /usr/local/lib/perl5/site_perl/5.8.8/YAML/Types.pm line 22
Everything that Class::Std exports
I started out with using anonymous
FORMATreferences. After all, they have to be useful for something. But sadly the internals thinks that it can copy them, and everything assumes that it can serialise them.
This class may be too sensible for
Acme::. I hope that the Makefile.PL makes up for it.
Nicholas Clark, <email@example.com>
Copyright (C) 2006 by Nicholas Clark
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install Acme::Class::Std, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Acme::Class::Std
For more information on module installation, please visit the detailed CPAN module installation guide.