Skip to content

Commit

Permalink
distribution Hash-Case-1.004.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
markov2 authored and Mark Overmeer committed Jan 22, 2018
1 parent 36bec10 commit e820148
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 262 deletions.
8 changes: 8 additions & 0 deletions Hash-Case-1.003/ChangeLog → ChangeLog
@@ -1,4 +1,12 @@

version 1.004: Fri Jun 8 15:37:31 CEST 2007

- fixed 2 typo's in POD (Thanks to CPANTS)

- add t/pod.t

- use oodist to create docs.

version 1.003: Mon Oct 27 07:58:44 CET 2003

- Added methods addPairs() and addHashData() to initialize a
Expand Down
11 changes: 0 additions & 11 deletions Hash-Case-1.003/Makefile.PL

This file was deleted.

93 changes: 0 additions & 93 deletions Hash-Case-1.003/lib/Hash/Case/Upper.pm

This file was deleted.

7 changes: 4 additions & 3 deletions Hash-Case-1.003/MANIFEST → MANIFEST
@@ -1,12 +1,13 @@
ChangeLog
MANIFEST
Makefile.PL
lib/Hash/Case.pm
lib/Hash/Case/Lower.pm
lib/Hash/Case/Upper.pm
lib/Hash/Case/Preserve.pm
lib/Hash/Case/Upper.pm
lib/Hash/Makefile.PL
Makefile.PL
t/10lower.t
t/20upper.t
t/30pres1.t
t/31pres2.t
MANIFEST
t/pod.t
26 changes: 26 additions & 0 deletions Makefile.PL
@@ -0,0 +1,26 @@
use ExtUtils::MakeMaker;

WriteMakefile
( NAME => 'Hash::Case'
, VERSION => '1.004'
, PREREQ_PM =>
{ Test::More => 0.47
}
, AUTHOR => 'Mark Overmeer'
, ABSTRACT => 'Play trics with hash keys'
);

sub MY::postamble { <<'__POSTAMBLE' }
# for DIST
RAWDIR = ../public_html/hash-case/raw
DISTDIR = ../public_html/hash-case/source
LICENSE = artistic
# for POD
FIRST_YEAR = 2002-2003,
EMAIL = perl@overmeer.net
WEBSITE = http://perl.overmeer.net/hash-case/
__POSTAMBLE

62 changes: 9 additions & 53 deletions Hash-Case-1.003/lib/Hash/Case.pm → lib/Hash/Case.pm
Expand Up @@ -7,26 +7,18 @@ use Tie::Hash;
use strict;
use Carp;

our $VERSION = 1.003;

=head1 NAME
=chapter NAME
Hash::Case - base class for hashes with key-casing requirements
=head1 CLASS HIERARCHY
Hash::Case
is a Tie::StdHash
is a Tie::Hash
=head1 SYNOPSIS
=chapter SYNOPSIS
use Hash::Case::Lower;
tie my(%lchash), 'Hash::Case::Lower';
$lchash{StraNGeKeY} = 3;
print keys %lchash; # strangekey
=head1 DESCRIPTION
=chapter DESCRIPTION
Hash::Case is the base class for various classes which tie special
treatment for the casing of keys. Be aware of the differences in
Expand Down Expand Up @@ -57,22 +49,16 @@ The actual casing is ignored, but not forgotten.
=back
=head1 METHODS
=chapter METHODS
=over 4
=cut

#-------------------------------------------

=item tie HASH, TIE, [VALUES,] OPTIONS
=tie tie HASH, TIE, [VALUES,] OPTIONS
Tie the HASH with the TIE package which extends L<Hash::Case>. The OPTIONS
differ per implementation: read the manual page for the package you actually
use. The VALUES is a reference to an array containing key-value pairs,
or a reference to a hash: they fill the initial hash.
Examples:
=examples
my %x;
tie %x, 'Hash::Case::Lower';
Expand Down Expand Up @@ -123,9 +109,7 @@ sub wrapper_init($)
$self;
}

#-------------------------------------------

=item addPairs PAIRS
=method addPairs PAIRS
Specify an even length list of alternating key and value to be stored in
the hash.
Expand All @@ -138,9 +122,7 @@ sub addPairs(@)
$self;
}

#-------------------------------------------

=item addHashData HASH
=method addHashData HASH
Add the data of a hash (passed as reference) to the created tied hash. The
existing values in the hash remain, the keys are adapted to the needs of the
Expand All @@ -154,9 +136,7 @@ sub addHashData($)
$self;
}

#-------------------------------------------

=item setHash HASH
=method setHash HASH
The functionality differs for native and wrapper hashes. For native
hashes, this is the same as first clearing the hash, and then a call
Expand All @@ -171,28 +151,4 @@ sub setHash($)
$self;
}

#-------------------------------------------

=head1 SEE ALSO
L<Hash::Case::Lower>
L<Hash::Case::Upper>
L<Hash::Case::Preserve>
=head1 AUTHOR
Mark Overmeer (F<mark@overmeer.net>).
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=head1 VERSION
This code is beta, version 1.003
Copyright (c) 2002-2003 Mark Overmeer. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

1;
54 changes: 5 additions & 49 deletions Hash-Case-1.003/lib/Hash/Case/Lower.pm → lib/Hash/Case/Lower.pm
@@ -1,44 +1,28 @@

package Hash::Case::Lower;
use base 'Hash::Case';

$VERSION = 1.003;

use strict;
use Carp;

=head1 NAME
=chapter NAME
Hash::Case::Lower - hash with enforced lower cased keys
=head1 CLASS HIERARCHY
Hash::Case::Lower
is a Hash::Case
is a Tie::StdHash
is a Tie::Hash
=head1 SYNOPSIS
=chapter SYNOPSIS
use Hash::Case::Lower;
tie my(%lchash), 'Hash::Case::Lower';
$lchash{StraNGeKeY} = 3;
print keys %lchash; # strangekey
=head1 DESCRIPTION
=chapter DESCRIPTION
Hash::Case::Lower extends Hash::Case, which lets you play various trics
with hash keys. See L<Hash::Case> for the other implementations.
=head1 METHODS
=over 4
=chapter METHODS
=cut

#-------------------------------------------

=item tie HASH, 'Hash::Case::Lower', [VALUES,] OPTIONS
=tie tie HASH, 'Hash::Case::Lower', [VALUES,] OPTIONS
Define HASH to have only lower cased keys. The hash is
initialized with the VALUES, specified as ref-array or
Expand All @@ -57,37 +41,9 @@ sub init($)
$self;
}

#-------------------------------------------

sub FETCH($) { $_[0]->{lc $_[1]} }
sub STORE($$) { $_[0]->{lc $_[1]} = $_[2] }
sub EXISTS($) { exists $_[0]->{lc $_[1]} }
sub DELETE($) { delete $_[0]->{lc $_[1]} }

#-------------------------------------------

=back
=head1 SEE ALSO
L<Hash::Case>
L<Hash::Case::Upper>
L<Hash::Case::Preserve>
=head1 AUTHOR
Mark Overmeer (F<mark@overmeer.net>).
All rights reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=head1 VERSION
This code is beta, version 1.003
Copyright (c) 2002-2003 Mark Overmeer. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

1;

0 comments on commit e820148

Please sign in to comment.