develooper Front page | perl.perl5.porters | Postings from June 2013

Re: key/value hash and index/valuse array slices syntax

Thread Previous | Thread Next
Leon Timmermans
June 11, 2013 10:53
Re: key/value hash and index/valuse array slices syntax
Message ID:
On Mon, Jun 10, 2013 at 11:41 PM, Ricardo Signes
<> wrote:
> I am interested in the answers to Yves' questions, and I think that these
> slices look worth pursuing further.  I think there are going to be a lot of
> questions about how they should work at the edges to figure out, but given the
> broad strokes, this is a feature that I would totally use and that seems quite
> sensible.

I find myself missing this feature with some regularity, I would
really like to have this.

One question I do have: what should it do with nonexistent keys? E.g.

my %first = (a => 1, b => 2);
my %second = %first{qw/a c/};

Should %second now contain «c => undef», not no c at all? I think I'm
currently leaning towards the latter, it seems like the more useful
behavior to me.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About