in reply to Re^3: Strange finish!!
in thread Strange finish!!

Not just javascript, but C and Java as well. In fact, Perl is the first language I've seen that allows (and actually encourages) trailing commas like that. I have to admit, it's really handy. I hate editing big SQL statements and moving things around because I inevitably have a select A,B,C, from FOO; give me an error. Perl gives us the luxury of making the statements easy to move around or append to. Nice feature that.
--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.

Replies are listed 'Best First'.
Re^5: Strange finish!!
by tilly (Archbishop) on Nov 07, 2007 at 20:16 UTC
    This is solvable with formatting. I always format SQL like this:
    SELECT A , B , C FROM FOO, BAR WHERE foo.barid = bar.barid AND foo.something = 'special value'
    and then adding/removing fields from the SQL statement is far less likely to give me errors.
Re^5: Strange finish!!
by AK108 (Friar) on Nov 07, 2007 at 16:52 UTC
    It's also very useful when generating Perl code via a program. You don't need to worry about omitting the final comma, which the generation code.
Re^5: Strange finish!!
by holli (Abbot) on Nov 10, 2007 at 05:40 UTC
    I chose the Javascript analogy because the Javascipt Object Notation is pretty similar to Perl datastructure syntax. (Basically replace => by : and you're done). From what I know there is no such thing for Java or C.


    holli, /regexed monk/