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 something
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?
OK, my brain has fried.
How can I do this:
my @list = qw/foo bar foo baz/;
my %hash = map { $_ = 1 } @men;
my @sort = sort keys %hash;
print "We have @sort\n"; # foo bar baz
without the %hash?
i.e. something akin to: my @sort = sort keys map { $_ = 1 } @list;
I've tried so many
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 } };
my @sort=sort keys %{ +{ map { $_ = undef } @list } };
^^
??
What does +{} do???
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 Clamp
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 +{ simply
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: