Changeset 9960 for docs/Perl6/FAQ

Show
Ignore:
Timestamp:
04/15/06 17:35:43 (3 years ago)
Author:
audreyt
Message:

* more clarficiation of binding a non-Scalar object into $var,

as requested by an anonymous commenter on the journal.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/FAQ/Capture.pod

    r9959 r9960  
    260260    @y = 42; # works - @y.elems is now 1 
    261261 
     262Note that C<$x = 42> fails because the C<:=> in C<$x := [1, 2, 3]> changes the 
     263underlying container of $x from a Scalar into an Array.  Compare this with the 
     264assignment case: 
     265 
     266    $x = [1,2,3]; 
     267    $x = 42;        # works just fine 
     268 
     269and also binding into an integer: 
     270 
     271    $x := 41; 
     272    $x = 42;        # fails - Int doesn't handle scalar assignment either 
     273