If that matters to you then you just save a copy of the variable's pos value and restore it after stomping on it. This is partly why it's writable.
$var = 'the quick brown fox'; while( $var =~ m/([aeiou])/g ) { # Save pos $pos = pos $var; # Do something to stomp on $var's pos value # Restore pos pos($var) = $pos; }
Fun Fun Fun in the Fluffy Chair
In reply to Re^2: pos()atively dangerous.
by diotalevi
in thread pos()atively mysterious.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |