Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: So what is an array slice anyway?

by beable (Friar)
on Aug 26, 2004 at 04:42 UTC ( [id://385905]=note: print w/replies, xml ) Need Help??


in reply to Re: So what is an array slice anyway?
in thread So what is an array slice anyway?

I know that lists and arrays are different, but as yet I haven't found in the documentation what the difference is. Where in the documentation is the difference between lists and arrays explained? I found this in perldata:
If you evaluate an array in scalar context, it returns the length of the array. (Note that this is not true of lists, which return the last value, like the C comma operator, nor of built-in functions, which return whatever they feel like returning.)

There is also a section on slices in perldata, but where does it say that a slice is a list?

  • Comment on Re^2: So what is an array slice anyway?

Replies are listed 'Best First'.
Re^3: So what is an array slice anyway?
by revdiablo (Prior) on Aug 26, 2004 at 05:49 UTC
    where does it say that a slice is a list?

    In a few places spread throughout perldata. Interestingly, the most direct statement on the subject is not from the section on Slices, but is a parenthetical remark in the section on Context:

    Assignment to a list (or slice, which is just a list anyway) also evaluates the righthand side in list context.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found