in reply to equivalent to Hash::Util for lists / arrays
output:#!/usr/bin/perl use strict; use warnings; use Data::Lock qw(dlock); my @folks = qw(larry curly moe); dlock(\@folks); eval { shift @folks; print "removed larry\n"; } or warn $@; eval { $folks[2] = 'joe'; print "replaced moe\n"; } or warn $@;
Modification of a read-only value attempted at /home/arun/test/dlock.p +l line 10. Modification of a read-only value attempted at /home/arun/test/dlock.p +l line 15.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: equivalent to Hash::Util for lists / arrays
by LanX (Saint) on Dec 21, 2010 at 16:29 UTC |