> >    > @a =^+ 1;
   > > 
   > > You *can*, but it's not the same as doing:
   > > 
   > >      @a ^=+ 1;
   > > 
   > > or:
   > > 
   > >      @a ^+= 1;
   > 
   > What does this last line do? ;-)

"And for the viewers at home, the answers are...

            @a =^+ 1;   # evaluate each element of the list (1) in a numeric
                        # context and assign the resulting list to @a
                        # i.e.  @a = $_ foreach +1;

            @a ^=+ 1;   # evaluate 1 in a numeric context and assign it to
                        # each existing element of @a
                        # i.e.  $_ = +1 foreach @a;

            @a ^+= 1;   # add-assign 1 to each element of @a
                        # i.e.  $_ += 1 foreach @a;


Damian

Reply via email to