[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] @$a[0] = 5;



On Sun, Jul 04, 1999 at 04:08:42PM +0200, Roland Bauer wrote:
> I found a similar code and I am quite sure the
> programmer simply wanted to use "$a[0]", however,
> it works and produces no warnings.
> 
> Can someone enlighten me, please?
> 
>  
> use strict;
> use diagnostics;
> 
> #my $a;
> #my $b;
> 
> @$a[0] = 5;
> @$b[0] = 6;
> 
> print @$a[0]; # prints "5"
> 

$a and $b are being used as references to arrays.

Whether or not the programmer needed to do that depends on what is done
with $a and $b elsewhere in the code.

Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe