Re: code line of the day

[email protected] ("A. Pagaltzis") Fri, 8 Sep 2006 01:23:37 +0200
Newsgroups perl.fwp
Message-ID <20060907232337.GC14113@klangraum>
* Uri Guttman <[email protected]> [2006-09-07 09:30]:
> this line of my code grew to its present form which i find amusing. 
> 
> 	@{$self->{templates}}{ keys %{$tmpls} } =
> 		map ref $_ eq 'SCALAR' ? \"${$_}" : \"$_", values %{$tmpls} ;

    my ( $k, $v );
    $self->templates->{ $k } = ref $v eq 'SCALAR' ? \"${$v}" : \"$v"
        while ( $k, $v ) = each %$tmpls;

Hmm. Don’t think I like that better.

[ delete 3 different attempts to make it better ]

Ugh. I think the core problem is that Perl actually does very
little to help you operate on hashes as a whole.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>