in reply to test case for Persistance.pm
in thread Persistence.pm

Need to use it with a call for the persistant variable to invoke the stored values. So test case works fine with
#!/usr/local/bin/perl -w # # name: persistest # # does stuff # works fine use vars qw( %hash ); use strict; use Persistence 'test.dat';
persistent '%hash';
my ($k, $v, $n);
while
(($k, $v) = each %hash) { $n++; print "$n: $k => $v\n"; } %hash = ( blue => 'berries', red => 'roses', black => 'coffee', yellow => 'bananas', ); END { persistent '%hash'; }
The loop funniness was due to using foreach instead of while over the calls to each %hash.

Nothing to see here. Move along.

perl -e 'print qq(Just another Perl Hacker\n)' # where's the irony switch?

Replies are listed 'Best First'.
Re: Ea answers own question!
by g0n (Priest) on Mar 30, 2005 at 13:21 UTC
    Just a quick observation: generally speaking when answering your own question, the convention is to post an Update: on the original node, so that readers don't need to read the entire thread to find out the problem is solved.

    Update: Just checked your homenode and found out you've been here on the monastery a lot longer than me! Still, I had to read the whole thread before finding out it was solved, so I guess it was worth the reminder.

    Update: OP now posted update on original post.

    g0n, backpropagated monk