Re: bad code to good golf

2007-12-10 Thread shmem
From the keyboard of A. Pagaltzis [09.12.07,21:50]: * Marcus Holland-Moritz [EMAIL PROTECTED] [2007-12-09 21:20]: We're all stuck at 21. :-) Well, `bless`, `shift` or `$_[0]`, `{}`, [EMAIL PROTECTED], and one comma are all inevitable. That's 15 characters in fixed strings alone. Then

Re: bad code to good golf

2007-12-10 Thread A. Pagaltzis
* shmem [EMAIL PROTECTED] [2007-12-10 12:55]: Well, if we were to return an array reference instead of a hash ref, sub [EMAIL PROTECTED],shift} works. Why does the shift get executed before an array reference is constructed - but not if a hashref is constructed - from an array? It

Re: bad code to good golf

2007-12-10 Thread Uri Guttman
AP == A Pagaltzis [EMAIL PROTECTED] writes: AP * shmem [EMAIL PROTECTED] [2007-12-10 12:55]: Well, if we were to return an array reference instead of a hash ref, sub [EMAIL PROTECTED],shift} AP In contrast, the hash constructors make a *copy* of the array, AP and that copy

Re: bad code to good golf

2007-12-10 Thread Steve Fink
On Dec 10, 2007 3:53 AM, shmem [EMAIL PROTECTED] wrote: Well, if we were to return an array reference instead of a hash ref, sub [EMAIL PROTECTED],shift} works. Why does the shift get executed before an array reference is constructed - but not if a hashref is constructed - from an array? No