[Html-widget] attributes

A. Pagaltzis pagaltzis at gmx.de
Fri Sep 22 16:45:59 CEST 2006


* Carl Franks <fireartist at gmail.com> [2006-09-22 16:30]:
> Maybe not consice enough to document as an idiom, though.

Uh, I wasn’t serious. (Just in case that wasn’t obvious. :-))

> obfu competition time!
> 
> my $attributes = sub {
>     my ( $self, %attrs ) = @_;
>     $self->attributes->{$_} = $attrs{$_} for keys %attrs;
>     return $self;
> }

    my $attributes = sub {
        my $self = shift;
        %$_ = ( %$_, @_ ) for $self->attributes;
        return $self;
    }

Regards,
-- 
#Aristotle
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



More information about the Html-widget mailing list