Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 browsing the Monastery: (4)
As of 2014-12-28 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls