while ($string =~ /./gs) { # whatever with $& # note that this incurs the penalty for using $& }