Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Tutorial RFC: Guide to Perl references, Part 1

by Monk::Thomas (Friar)
on Jul 09, 2015 at 11:54 UTC ( [id://1133946]=note: print w/replies, xml ) Need Help??


in reply to Tutorial RFC: Guide to Perl references, Part 1

When converting from 'normal' to 'reference' I propose you keep the same value.

Instead of

my $x  = $array[0];
my $y = $aref->1;
change the example to
my $x = $array[0];
my $x = $aref->[0];

Otherwise someone who is totally new to references might get the impression you also need to increase the array index by one...

P.S.: Maybe you should also explain the meaning of 'aref' / 'href'.

  • Comment on Re: Tutorial RFC: Guide to Perl references, Part 1

Replies are listed 'Best First'.
Re^2: Tutorial RFC: Guide to Perl references, Part 1
by stevieb (Canon) on Jul 10, 2015 at 13:45 UTC

    Very keen observation, thanks!

    That's a trivial fix that absolutely makes sense.

    -stevieb

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-24 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found