Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: How many loops are there in Perl?

by repellent (Priest)
on Jan 31, 2012 at 08:32 UTC ( #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 (Archbishop) 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.


      as you wish :)

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

      I'm surprised nobody tried s///e

      Cheers Rolf


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950905]
[Corion]: Discipulus: Better buy a new PC (well, self-build one from parts) than buy a new car :-)
[choroba]: the boot time on my laptops is more than satisfactory, but the desktop boots in 30+ secs
[choroba]: because of some problems of the wicked with systemd :-(
[Corion]: choroba: Just imagine how bad it must be without systemd ;-D
[choroba]: but I'm not sure it's worth my time...
NodeReaper shudders

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2017-07-27 09:14 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (407 votes). Check out past polls.