in reply to Persistence.pm
produces#!/usr/local/bin/perl -w # # name: persistest # # does stuff # works fine use vars qw( %hash ); use strict; use Persistence 'test.dat'; my ($k, $v, $n); foreach (($k, $v) = each %hash) { $n++; print "$n: $k => $v\n"; } %hash = ( blue => 'berries', red => 'roses', black => 'coffee', yellow => 'bananas', ); END { persistent '%hash'; }
Warnings removed to improve readability. Why it iterates twice when it can't find the values, I can't figure.$ ./persistest 1: => 2: =>
janitored by ybiC: Append "for Persistance.pm" to title for better site search results
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Ea answers own question!
by Ea (Chaplain) on Mar 30, 2005 at 12:55 UTC | |
by g0n (Priest) on Mar 30, 2005 at 13:21 UTC |