1Hash::Case::Preserve(3)User Contributed Perl DocumentatioHnash::Case::Preserve(3)
2
3
4
6 Hash::Case::Preserve - hash with enforced lower cased keys
7
9 Hash::Case::Preserve
10 is a Hash::Case
11 is a Tie::StdHash
12
14 use Hash::Case::Preserve;
15 tie my(%cphash), 'Hash::Case::Preserve';
16 $cphash{StraNGeKeY} = 3;
17 print keys %cphash; # StraNGeKeY
18 print $cphash{strangekey}; # 3
19 print $cphash{STRANGEKEY}; # 3
20
22 Hash::Case::Preserve extends Hash::Case, which lets you play various
23 trics with hash keys. See Hash::Case for the other implementations.
24
26 $obj->addHashData(HASH)
27
28 See "METHODS" in Hash::Case
29
30 $obj->addPairs(PAIRS)
31
32 See "METHODS" in Hash::Case
33
34 $obj->setHash(HASH)
35
36 See "METHODS" in Hash::Case
37
38 tie(HASH, 'Hash::Case::Preserve', [VALUES,] OPTIONS)
39
40 Define HASH to be case insensitive, but case preserving. The hash
41 is initialized with the VALUES, specified as ref-array or ref-hash.
42
43 OPTIONS is a list of key/value pairs, which specify how the hash
44 must handle preservation. Current options:
45
46 Option--Default
47 keep <required>
48
49 . keep => => 'FIRST' | 'LAST'
50
51 Which casing is the prefered casing? The FIRST appearance or
52 the LAST. Only stores will affect the casing, deletes will
53 undo the definition. Defaults to LAST, which is slightly
54 faster.
55
57 This module is part of Hash-Case distribution version 1.006, built on
58 June 19, 2008. Website: http://perl.overmeer.net/hash-case/
59
61 Copyrights 2002-2003,2007-2008 by Mark Overmeer. For other contributors
62 see ChangeLog.
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself. See
66 http://www.perl.com/perl/misc/Artistic.html
67
68
69
70perl v5.12.0 2008-06-19 Hash::Case::Preserve(3)