Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: pos()atively dangerous.

by diotalevi (Canon)
on Dec 16, 2002 at 14:15 UTC ( #220207=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://220207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-05-23 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?