I will prefer to use this way instead:
$rarray->[1];

The arrow indicates a reference.

ukhas jean wrote:
> Was playing with references and came across a feature of Perl which 
> puzzles me ... (I was purposefully not using the arrow -> notation to 
> make sure I am well versed with the other format too ... that's when I 
> spotted the below prob.)
>  
> use strict;
> use warnings;
>
> my @arr = (10,20,30);
> my $rarray = [EMAIL PROTECTED];
> print "\n====$$rarray[1]=======\n";
>  
> O/p:-
> ====20=======
>  
> This is just fine ...
>  
> For fun i typed the below line ... and Eureka!!! It gives me the same 
> output ...
> print "[EMAIL PROTECTED]";
>  
> Q. Is @$rarray[1] a proper way to access an element ... The book I 
> read never mentioned this ... or is it something that only I am 
> unaware of ??
>  
> Best,
> Ukh
>
> ------------------------------------------------------------------------
> Get your own web address for just $1.99/1st yr 
> <%20http://us.rd.yahoo.com/evt=43290/*http://smallbusiness.yahoo.com/domains>.
>  
> We'll help. Yahoo! Small Business 
> <http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/>.
> ------------------------------------------------------------------------
>
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to