Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Java accepts Perl leadership

by broquaint (Abbot)
on Jun 28, 2004 at 04:33 UTC ( #370099=note: print w/ replies, xml ) Need Help??


in reply to Re: Java accepts Perl leadership
in thread Java accepts Perl leadership

Provide the desired functionality then :)

{ package Container; use overload ( '@{}' => sub { return [sort keys %{$_[0]}] }, fallback => 1, ); sub new { return bless { map { $_ => 1 } @_[1 .. $#_] }, $_[0]; } } my $c = Container->new( qw/ e1 e2 e3 / ); print "member $_\n" for @$c; __output__ member e1 member e2 member e3
HTH

_________
broquaint


Comment on Re^2: Java accepts Perl leadership
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://370099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-07-31 08:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (246 votes), past polls