Tie::Array::RestrictUpdatesTie::Array::RestrictUpdates can limit the number of times you change elements in an array. | |
Download |
Tie::Array::RestrictUpdates Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Hendrik Van Belleghem
- Publisher web site:
- http://search.cpan.org/~beatnik/Filter-CBC-0.10/lib/Filter/CBC.pm
Tie::Array::RestrictUpdates Tags
Tie::Array::RestrictUpdates Description
Tie::Array::RestrictUpdates can limit the number of times you change elements in an array. Tie::Array::RestrictUpdates can limit the number of times you change elements in an array.SYNOPSIS use Tie::Array::RestrictUpdates; tie @foo,"Tie::Array::RestrictUpdates",1; # Default limit is 1. # Every element from the array can only be changed once @foo = qw(A B C D E); for(0..4) { $foo = lc $foo; } print join("-",@foo); # This will print A-B-C-D-E and a bunch of warnings -or- use Tie::Array::RestrictUpdates; tie @foo,"Tie::Array::RestrictUpdates",; # This forces the limits of the first 3 indexes # This also forces any extra elements from the array to have a 0 limit # and therefor be unchangable/unsettable @foo = qw(A B C D E); for(0..3) { $foo = lc $foo; } for(0..3) { $foo = uc $foo; } for(0..3) { $foo = lc $foo; } for(0..3) { $foo = uc $foo; } print join("-",@foo); # This will print A-b-C-d and a bunch of warningsRequirements:· Perl
Tie::Array::RestrictUpdates Related Software