Hi, relatively new to Perl and hoping that someone might be able to point me in the right direction.
I want to accept a group of 1 or more user defined numbers ("thresholds") from a user running the script.
./script 1000 8000 5000 2000
The script will read through each line of a file, searching for lines (specifically, the 10th element of each line) containing but not exceeding or crossing the boundries of each of the other thresholds
If the thresholds are 1000, 8000, 5000, 2000, then search each line fo
+r a threshold that is either
-Greater than 1000, but less than 2500
-Greater than 8000
-Greater than 5000, but less than 8000
-Greater than 2500, but less than 5000
Each line of the file will resemble the following. The only part of this line that I am concerned with is the "Pending=XXXXX" element
2011-09-12 10:20:54.473 hostname [13996,14019]: (WALL, MDConnection.cp
+p:420) Received data on Connection[OPRA-GRP13-16]. Pending=220. Total
+ Messages processed by Connection [OPRA-GRP13-16]=97190000
I have a simple script that that asks the user for a single threshold, then looks at the 10th element of each line, further tallying each instance for a final "count" of how many lines exceed this threshold. But am having a lot of trouble articulating any ideas on how to go about this; first looping through the array of thresholds the user gave me, then using that to create a single line of code (if statement, for example) that meets the criteria of the user specified thresholds.
Is there an easy way to do this?
I'm not sure if it will be any use, but I can provide code examples of my current script, if necessary.