Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-02-20 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (268 votes). Check out past polls.

    Notices?