;) $a is an anonymous reference to the array defined @$a resolves that reference [EMAIL PROTECTED] prints out the index of the last element of array $a->[elemmentnumber] is used to access an element thru an array reference. so $a->[EMAIL PROTECTED] simply gives you the last element of the array
an easier method(if you think so) might be perl -e '$a=[1,2,3,4,76]; print $a->[EMAIL PROTECTED]' -----Original Message----- From: Marcos Rebelo [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 8:23 PM To: Perl Beginners Subject: Simplify perl -e '$a = [1,2,3,4,7]; print $a->[EMAIL PROTECTED]' This is correctly printing '7' but '$a->[EMAIL PROTECTED]' seems to be encripted code. Can I write this in a cleaner way? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> ********************************************************* Disclaimer: The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT. This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use ********************************************************* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>