Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: pos()atively dangerous.

by diotalevi (Canon)
on Dec 16, 2002 at 14:15 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found