ajmalton has asked for the wisdom of the Perl Monks concerning the following question:
Ok, so I'm maintaining some quirky old (2000-2010) perl code not written by me and I see a large number of list initializations of the form:
Now as far as I know this is a pointless variation on@foobar = splice(@foobar,@foobar)
Can any wise one think of _any_ reason why I shouldn't just replace all these weird splices with the literal empty list?@foobar = ( )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unusual (and pointless?) idiom in old code
by bart (Canon) on Sep 22, 2011 at 11:53 UTC | |
|
Re: Unusual (and pointless?) idiom in old code
by chrestomanci (Priest) on Sep 22, 2011 at 11:52 UTC | |
|
Re: Unusual (and pointless?) idiom in old code
by kcott (Archbishop) on Sep 22, 2011 at 11:57 UTC | |
by ajmalton (Acolyte) on Sep 22, 2011 at 17:06 UTC | |
|
Re: Unusual (and pointless?) idiom in old code
by jwkrahn (Abbot) on Sep 22, 2011 at 11:54 UTC | |
|
Re: Unusual (and pointless?) idiom in old code
by TomDLux (Vicar) on Sep 22, 2011 at 17:24 UTC |