Help for this page

Select Code to Download


  1. or download this
      DB<100> @a=(1,2,3)
     => (1, 2, 3)
    ...
    
      DB<103> $a[0]          # @a didn't change
     => 1
    
  2. or download this
    >>> a=[1,2,3]
    >>> b=a
    >>> b[0]=42
    >>> a[0]
    42
    
  3. or download this
      DB<104> $a=[1,2,3]
     => [1, 2, 3]
    ...
    
      DB<107> $a->[0]  # original changed 
     => 42
    
  4. or download this
      DB<108> \@a
     => [1, 2, 3]
    ...
    
      DB<111> $a[0]         # original changed 
     => 666
    
  5. or download this
      DB<112> @$b
     => (666, 2, 3)    # now a (list) not an [array-ref]