News for hackers. Stuff that matters.
Re:Perl, the first postmodern computer language (1999) by matthewpersico on Wednesday May 04, 2022 @08:17PM (#31267697)
Because Perl is context sensitive and what we care about is not what is being stored but what is being accessed.

'array' is the variable.

'@array' gives me the list in 'array'.

'$array[1]' gives me the scalar ($) value at array[1].

`@array[3..7]` gives me the list (@) of values at array indexes 3-7, inclusive on both sides. (Why does Python use open ended ranges? <facepalm>) (Why is Python's slicing syntax an inflexible loop? <facepalm again>)

`@array[1]`, by the way gives me the list of values at array index 1, which is the same as `$array[1]`

There are no comments on this comment yet.