Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Sum of N elements in an M element array

by karlgoethebier (Abbot)
on Feb 01, 2020 at 20:28 UTC ( #11112244=note: print w/replies, xml ) Need Help??


in reply to Re: Sum of N elements in an M element array
in thread Sum of N elements in an M element array

I stared a little while at the code you provided wondering why and how it works and jumped to the conclusion that using Data::PowerSet is by far the better solution. Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Replies are listed 'Best First'.
Re^3: Sum of N elements in an M element array
by Anonymous Monk on Feb 02, 2020 at 00:44 UTC
    He's building a regex which is trying to match n numbers, because of the (fail) it keeps backtracking to match all possibilities.

    The embedded Perl code ensures the output before backtracking to the next match.

    I actual like seeing such code as answers to lazy questions. ;)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2020-09-24 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I don’t succeed, I …










    Results (132 votes). Check out past polls.

    Notices?