LWN.net Logo

OpenBSD 4.1: Puffy Strikes Again (O'ReillyNet)

OpenBSD 4.1: Puffy Strikes Again (O'ReillyNet)

Posted May 6, 2007 7:23 UTC (Sun) by jengelh (subscriber, #33263)
In reply to: OpenBSD 4.1: Puffy Strikes Again (O'ReillyNet) by tetromino
Parent article: OpenBSD 4.1: Puffy Strikes Again (O'ReillyNet)

>3. one of the fundamental features of the perl5 syntax - namely, that lists and hashes are prefixed with @ and %, but elements of a list or hash are prefixed with $ - is actually pretty silly; there is no good reason for it. It would make more sense to write @list[5] than $list[5], and that's how it will be done in perl6. However, if this one example makes you think that perl5 is a mess, then we have different definitions of "mess".

Actually, one uses $list[5] *today*! Like the book or some manpage says, $ is the "singular" and @ is the "plural", as in

@list[5,6] = qw(foo bar);
print $list[5], "\n";

You /can/ use @list[5], but it does not make much sense.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds