The key is the regular expression, which grabs the numbers out of the line (assuming your data is sane)
while (<FILE>) {
# $number will only get set if the current line contains one or mo
+re digits in between parentheses
my ($number) = /\((\d+))/;
# do something with $number
}
I'd suggest reading perlre (but check your own system's docs) and poke around for phrases like "regular expression memory", which is the technique being employed here.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor |