Re: lvalue hash slice
"A. Pagaltzis" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <20030930222421.GA6925@klangraum> |
* Gaal Yahas <[email protected]> [2003-09-30 22:01]: > Has this always worked? I coulda sworn I tried it in the past > with no luck... It has always worked since I started Perl (sometime around 5.4). I'd make an educated guess that it has been available at least as long as C<(LIST)[@INDICES]> has. That would mean at least ever since Perl5; likely as early as Perl4. > Okay, score down for solution, score up for obfuscation...! :p Why obfuscation? Hash slice as lvalue is extremly elegant and *very* readable in my opinion. It requires very little verbiage and communicates the intent clearly. For me, Perl's extremly expressive data structure access syntax and its ability to operate on lists without the programmer having to explicitly iterate is pretty much the main selling point of the language. I *very* much miss it when I try to work with machine oriented languages. If I had a nickel for every time I've written "for (i = 0; i < N; i++)" in C I'd be a millionaire. -- Michael Vanier -- Regards, Aristotle "If you can't laugh at yourself, you don't take life seriously enough."