Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Your favourite gory detail...

by Ido (Hermit)
on Jun 25, 2004 at 02:03 UTC ( #369534=note: print w/replies, xml ) Need Help??


in reply to Re: Your favourite gory detail...
in thread Your favourite gory detail...

Took me about an hour to find code that has different output with and without that line... But it was fun;), so I won't spoil...

$foo='hello'; for(1..5){ $foo=~/(?=(.))/g; pos($foo)=pos($foo); print $1 }

"The additional state of being matched with zero-length is associated with the matched string, and is reset by each assignment to pos()."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2021-10-24 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?