Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: How to count substrings in an array?

by AnomalousMonk (Abbot)
on Feb 03, 2013 at 11:16 UTC ( #1016820=note: print w/ replies, xml ) Need Help??


in reply to Re: How to count substrings in an array?
in thread How to count substrings in an array?

... and you don't even need the '+' on the  += operator:

>perl -wMstrict -lE "my $s = 'abababa'; my $t = 'aba'; ;; my $c = map /(?=$t)/g, qw(abababa ababa); say $c; " 5


Comment on Re^2: How to count substrings in an array?
Select or Download Code
Replies are listed 'Best First'.
Re^3: How to count substrings in an array?
by BrowserUk (Pope) on Feb 03, 2013 at 11:32 UTC
    and you don't even need the '+' on the += operator:

    Of course I don't. Much nicer!


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-07-31 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls