Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to count substitutions on an array

by Limbic~Region (Chancellor)
on Aug 13, 2016 at 02:08 UTC ( #1169685=note: print w/replies, xml ) Need Help??

in reply to How to count substitutions on an array

Anonymous Monk,
Why are you trying to cram everything into a single line?
my $count = 0; for (@array) { # I've had no difficulty counting substitutions on individual lin +e replacements # my $individual_line_replacement_count = ...; $count += $individual_line_replacement_count; }

Cheers - L~R

Replies are listed 'Best First'.
Re^2: How to count substitutions on an array
by Anonymous Monk on Aug 13, 2016 at 02:29 UTC

    I didn't know how to do it in any way other than a *nested* "foreach" loop. On an array with tens of thousands of items, and needing to iterate through the entire array for a list of thousands of words/phrases, I might have been waiting a long time.

    I wish it were easier to search online for specific coding issues with programming. Sigh.

    Your solution works for me. Thank you very much.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1169685]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2018-07-19 21:35 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (420 votes). Check out past polls.