Skip Menu |

This queue is for tickets about the Hash-Case CPAN distribution.

Report information
The Basics
Id: 54059
Status: resolved
Priority: 0/
Queue: Hash-Case

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.006
Fixed in: (no value)



Subject: Feature request: Nestable
It would be cool for Hash::Case to work with multilevel hashes. my %h; tie %h, 'Hash::Case::Nestable'; $h{abc}{def} = 42; say $h{ABC}{DEF}; # prints 42 This would be similar to Tie::RefHash::Nestable in the perl distribution.
duplicate
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #54059] Feature request: Nestable
Date: Thu, 28 Jan 2010 14:43:06 +0100
To: EDAVIS via RT <bug-Hash-Case [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* EDAVIS via RT (bug-Hash-Case@rt.cpan.org) [100128 13:31]: Show quoted text
> Thu Jan 28 08:31:19 2010: Request 54059 was acted upon. > Transaction: Ticket created by EDAVIS > Queue: Hash-Case > Subject: Feature request: Nestable > Broken in: 1.006 > Severity: Wishlist > > It would be cool for Hash::Case to work with multilevel hashes. > > my %h; > tie %h, 'Hash::Case::Nestable'; > $h{abc}{def} = 42; > say $h{ABC}{DEF}; # prints 42 > > This would be similar to Tie::RefHash::Nestable in the perl distribution.
What about via one of these options? tie %h, 'Hash::Case::Lower', nested => 1; tie %h, 'Hash::Case::Lower', recurse => 1; tie %h, 'Hash::Case::Lower', nested => 'Hash::Case::Upper'; tie %h, 'Hash::Case::Lower', nestings => [ 'Hash::Case::Upper', 'Hash::Case::Preserve' ]; -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #54059] Feature request: Nestable
Date: Thu, 28 Jan 2010 15:14:15 +0100
To: EDAVIS via RT <bug-Hash-Case [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Mark Overmeer (mark@overmeer.net) [100128 14:43]: Show quoted text
> * EDAVIS via RT (bug-Hash-Case@rt.cpan.org) [100128 13:31]: > What about via one of these options? > > tie %h, 'Hash::Case::Lower', nested => 1; > tie %h, 'Hash::Case::Lower', recurse => 1; > tie %h, 'Hash::Case::Lower', nested => 'Hash::Case::Upper'; > tie %h, 'Hash::Case::Lower', nestings =>
Oh, no... that's not possible: only ::Preserve has a seperate administration for the options. So, should be something like tie %h, 'Hash::Case::Nested', recurse => 'Hash::Case::Upper'; tie %h, 'Hash::Case::Nested', nestings => [ 'Hash::Case::Upper', 'Hash::Case::Preserve' ]; It will be quite expensive to store new data. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #54059] Feature request: Nestable
Date: Thu, 28 Jan 2010 15:45:28 +0100
To: EDAVIS via RT <bug-Hash-Case [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* MARKOV Solutions (solutions@overmeer.net) [100128 15:14]: Show quoted text
> * Mark Overmeer (mark@overmeer.net) [100128 14:43]: > tie %h, 'Hash::Case::Nested', recurse => 'Hash::Case::Upper'; > > tie %h, 'Hash::Case::Nested', nestings => > [ 'Hash::Case::Upper', 'Hash::Case::Preserve' ];
Or even: tie %h, 'Tie::Hash::Nested', recurse => 'Hash::Case::Upper'; tie %h, 'Tie::Hash::Nested', nestings => [ 'Hash::Case::Preserve', 'Tie::Hash::Other', sub {...} ]; Still thinking about your idea. The reason is: I need an IO::Dir::CaseInsensitive which is capable of storing filenames multiple levels deep. I have meta-data files which contain these filenames, and CDROMs/Windows which broke the casings of the filenames :( So: this module would also help me ;-) -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #54059] Feature request: Nestable
Date: Mon, 15 Feb 2010 10:29:42 +0100
To: EDAVIS via RT <bug-Hash-Case [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* EDAVIS via RT (bug-Hash-Case@rt.cpan.org) [100128 13:31]: Show quoted text
> Thu Jan 28 08:31:19 2010: Request 54059 was acted upon. > Transaction: Ticket created by EDAVIS > Queue: Hash-Case > Subject: Feature request: Nestable > > It would be cool for Hash::Case to work with multilevel hashes. > This would be similar to Tie::RefHash::Nestable in the perl distribution.
This was a very nice challenge. It took me many hours to produce a few lines of code. Certainly, this will be used as presentations on the Dutch and German Perl Workshops ;-) See Tie::Nested, which I just uploaded to CPAN. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Please try Tie::Nested.