in reply to Re: pos()atively dangerous.
in thread pos()atively mysterious.
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
|
|---|