What's the dif between: @_[0] and $_[0] ?

Discussion in 'Perl' started by user, Dec 9, 2003.

  1. user

    user Guest

    Same question for arrays in general:
    e.g. @myArray[3] vs. $myArray[3]

    Most texts I've seen use the scalar version, but I've also seen the
    array version. In simple testing I can't find a difference. Is this
    just a case of "there's more than one way to do things", or are there
    subtle differences I'm too new to have seen?

    Thanks.
     
    user, Dec 9, 2003
    #1
    1. Advertising

  2. user wrote:
    > Same question for arrays in general:
    > e.g. @myArray[3] vs. $myArray[3]
    >
    > Most texts I've seen use the scalar version, but I've also seen the
    > array version. In simple testing I can't find a difference. Is
    > this just a case of "there's more than one way to do things", or
    > are there subtle differences I'm too new to have seen?


    Enable warnings, and you'll notice a difference.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Dec 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,279
  2. julian_m

    different css to dif resolution

    julian_m, Nov 24, 2005, in forum: HTML
    Replies:
    7
    Views:
    538
    CalgaryWebGuy
    Nov 25, 2005
  3. Santa
    Replies:
    1
    Views:
    1,096
    Mark A. Odell
    Jul 17, 2003
  4. malli
    Replies:
    4
    Views:
    576
    Manivannan Palanichamy
    Jul 8, 2007
  5. PerlFAQ Server
    Replies:
    0
    Views:
    367
    PerlFAQ Server
    Jan 6, 2011
Loading...

Share This Page