in reply to Unusual (and pointless?) idiom in old code

In list context (as you have here), no elements are removed so none are returned: resulting in an empty list. This holds true for splice() - Perl v5.14 and back as far as splice() - Perl v5.8 (maybe earlier versions as well).

While possibly considered pedantic, you show no terminating semicolon. Look closely at surrounding code: is this the entire statement or just part of a larger construct?

Update: s/split/splice/ (2 instances) - thanks AnomalousMonk.

-- Ken

  • Comment on Re: Unusual (and pointless?) idiom in old code

Replies are listed 'Best First'.
Re^2: Unusual (and pointless?) idiom in old code
by ajmalton (Acolyte) on Sep 22, 2011 at 17:06 UTC
    Thanks to all. I am happy that there is no wisely hidden reason for having done this. There is other internal evidence that probably the programmer had some other language in mind. Several old perl hands have commented to me that they never ever saw this oddness before. It makes me feel better that _I_ never have, either. I'm going to replace them all with ()'s. Then comes the hard part, getting rid of all the global variables I've inherited.