in reply to Seemingly enigmatic data structures

Linda,

In this context using arrays and hashes, the -> operator:

must

It must be used to access the first data structure level of a reference to an array:

my $ra_staff = \@staff; $ra_staff->[0]...
must not

It must not be used to access the first data structure level of an array:

$staff[0]...
may

It is optional everywhere else: as shown by lidden above.

Regards,

PN5

Replies are listed 'Best First'.
Re^2: Seemingly enigmatic data structures
by tphyahoo (Vicar) on Mar 05, 2005 at 12:16 UTC
    • must be used in one place
    • must not be used in one place
    isn't this a contradiction?

    UPDATE: Ah, OK, I get it now, more or less. Though I do think that could have been more clearly worded.

    "...first data structure level of a reference" is pretty gibberishy to me. But the examples make it more or less clear.

        Thinking "between" helps. But wouldn't that just be brackets and braces? Where are arrows optional between parens?