[PREV - CODE_EXAMPLE]    [TOP]
NEXT

FRAMES_OF_REFERENCE


  A string is just an
  ordered sequence of       Problematic: Recording
  bytes indexed from        the locations of
  zero.                     changes in a string as
                            the changes change the
                            length of the string.

  $_ = "The Cat in the Hat";  # 'The Caaat in the Haaat'
  s{a}{  push @locs, pos; 'aaa' }xeg;

        0   T             0   T
        1   h             1   h
        2   e             2   e        What locations
        3                 3            are in @locs?
        4   C             4   C
    *   5   a    =>       5   a
        6   t             6   a
        7                 7   a
        8   i             8   t
        9   n             9
       10                10   i
       11   t            11   n
       12   h            12
       13   e            13   t
       14                14   h
       15   H            15   e
    *  16   a            16
       17   t            17   H
                         18   a
                         19   a
                         20   a
                         21   t

--------
[NEXT - TWO_FRAMES]