Acme-State
view release on metacpan or search on metacpan
lib/Acme/State.pm view on Meta::CPAN
# when we eval something in code in main::, it comes up as being exported from main::. *sigh*
$node->{$k} = *{$package . $k}{CODE};
}
} else {
$node->{$k} = *{$package.$k}{SCALAR} unless ref(*{$package.$k}{SCALAR}) eq 'GLOB';
}
}
return $node;
}->('main::');
# use Data::Dumper; print "debug: ", Data::Dumper::Dumper($tree), "\n";
local $Storable::Deparse = $wantcoderefs;
my $save_fn = save_file_name();
# $save_fn =~ s{/-}{/x}g; warn "saving to: ``$save_fn.new''";
Storable::nstore $tree, $save_fn.'.new' or die "saving state failed: $!";
# warn "okay, Storable::nstore done";
lib/Acme/State.pm view on Meta::CPAN
=head1 SEE ALSO
You *could* use an ORM, and wind up translating all of your data to a relational schema you
don't care about or else have it automatically mapped and completely miss the point of
using a relational database.
You *could* just store your data in the Ether with Memcached.
You could C<INSERT> and C<UPDATE> manually against a database to store every little tidbit and factoid
as they're computed.
You could use BerekelyDB, including the build-in legacy C<dbmopen> and mangle everything
down to a flat associative list.
You could use L<Data::Dumper> to write a structure to a file and C<eval> that on startup
and keep all of your precious application data in one big datastructure and still not be able to
persist entire objects.
You could use C<dump> and keep waiting for the day that someone finally writes C<undump>.
But what's the fun in that?
None of those are one C<use> line and then never another thought.
That's like work for something.
Work is for suckers.
We're Perl programmers.
If it's not automatic, it's not worth doing.
( run in 1.505 second using v1.01-cache-2.11-cpan-a5abf4f5562 )