Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How many loops are there in Perl?

by repellent (Priest)
on Jan 31, 2012 at 08:32 UTC ( [id://950905]=note: print w/replies, xml ) Need Help??


in reply to How many loops are there in Perl?

[1 .. 5] ~~ sub { say "Inside loop $_[0]?" }; # Perl 5.10.1+

Replies are listed 'Best First'.
Re^2: How many loops are there in Perl?
by davido (Cardinal) on Jan 31, 2012 at 18:51 UTC

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


    Dave

      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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found