$str = "abc"; { local ($_1, $_2, ...); for (1, 2, 3) { $str =~ ?(.)?g and ($_1, $_2, ...) = ($1, $2, ...); print $_1; } }