[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Copying hashes




I'm using the following little snippet of code:
    my $r = $sth->fetchrow_hashref() or return 0;
    $self->{keys %$r} = $self->{values %$r};

I can't imagine there's a better way to plug the values from %$r into my
hash, but I figure it's worth asking about...

xoxo,
Andy


--
# Andy Lester
%_=split';','.; Perl ;@;st a;m;ker;p;not;o;hac;t;her;y;ju';
print map $_{$_}, split //,
'andy@petdance.com'


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe