Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to count substitutions on an array

by Limbic~Region (Chancellor)
on Aug 13, 2016 at 02:08 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1169685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found