Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: How many loops are there in Perl?

by davido (Archbishop)
on Jan 31, 2012 at 18:51 UTC ( #951041=note: print w/ replies, xml ) Need Help??


in reply to Re: How many loops are there in Perl?
in thread How many loops are there in Perl?

That's one for the obfu-toolkit. I'm surprised we haven't seen abuse of the regex engine and (?{...}) blocks.


Dave


Comment on Re^2: How many loops are there in Perl?
Download Code
Re^3: How many loops are there in Perl?
by LanX (Canon) on Feb 01, 2012 at 23:04 UTC
    as you wish :)

    DB<72> (" "x10) =~ m/ (?{print $x++})/g => (" ", " ", " ", " ", " ", " ", " ", " ", " ", " ") 0123456789

    I'm surprised nobody tried s///e

    Cheers Rolf

    update:

    DB<20> $_=" "x10; s/ /print $x++/ge => 10 0123456789

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-09-17 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (61 votes), past polls