Newsgroups: comp.lang.perl.misc
From: PerlFAQ Server <br...@stonehenge.com>
Date: Tue, 13 May 2008 06:03:02 -0700
Local: Tues, May 13 2008 9:03 am
Subject: FAQ 4.40 What is the difference between $array[1] and @array[1]?
This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.40: What is the difference between $array[1] and @array[1]? The former is a scalar value; the latter an array slice, making it a Sometimes it doesn't make a difference, but sometimes it does. For $good[0] = `some program that outputs several lines`; with @bad[0] = `same program that outputs several lines`; The "use warnings" pragma and the -w flag will warn you about these -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They If you'd like to help maintain the perlfaq, see the details in You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||