On Wed, 3 Jan 2001, Shevek wrote:
> > my @sort=sort keys %{ +{ map { $_ => undef } @list } };
> Maybe I'm missing something here, but how is this different to
> my @sort = sort @list;
values in @sort are unique?
On Tue, 2 Jan 2001, Peter Corlett wrote:
> On Sat, Dec 30, 2000 at 06:35:18PM +, Tony Bowden wrote:
> > i.e. something akin to: my @sort = sort keys map { $_ => 1 } @list;
>
> I'm thinking that this might work:
>
> my @sort=sort keys %{ +{ map { $_ => undef } @list } };
Maybe I'm missing s
On Tue, Jan 02, 2001 at 03:36:17PM -, Jonathan Peterson wrote:
[ on +{ ... } ]
> Is this explained in the latested Camel, because it doesn't show up in my
> pocket refernce at all
It's almost a compile-time pragma, and I'm fairly sure it's in the camel.
Anyway, "perlop" has this to say:
> > What does +{} do???
>
> It says 'Yes damnit, I want an anonymous hash here, not one
> of those pesky
> block thingies'
Ah. Not closely related to the concept of addition then. Couldn't they have
used !%{} or +%{} or something? Also, what _IS_ +{ in this case? It's not an
operator, so is +{ si
On Tue, Jan 02, 2001 at 03:21:15PM -, Jonathan Peterson wrote:
>> my @sort=sort keys %{ +{ map { $_ => undef } @list } };
>^^
> What does +{} do???
"{ ... }" turns the list within into an anonymous hash reference. The "+" is
to disambiguate it from a BLOCK. The "%{ ..
On Tue, Jan 02, 2001 at 03:21:15PM -, Jonathan Peterson wrote:
>
> > my @sort=sort keys %{ +{ map { $_ => undef } @list } };
> ^^
>
> ??
>
> What does +{} do???
It says 'Yes damnit, I want an anonymous hash here, not one of those pesky
block thingies'
--
Richard
> my @sort=sort keys %{ +{ map { $_ => undef } @list } };
^^
??
What does +{} do???
On Sat, Dec 30, 2000 at 06:35:18PM +, Tony Bowden wrote:
> i.e. something akin to: my @sort = sort keys map { $_ => 1 } @list;
I'm thinking that this might work:
my @sort=sort keys %{ +{ map { $_ => undef } @list } };