How do you make perl search for say today([^&]+)today, where ([^&]+) is any number, then make it a variable, for example $12345. Then change it to 123.45, and then do math to it, 123.45*.40 = 49.38 with 49.38 being what the $12345 variable is at the end??? What perl is searching is... Today: today408today Clicks: 34 Yesterday: yesterday555yesterday Clicks: 61 This Month: this11360this Clicks: 812 Last Month: last5350last Clicks: 454 where the numbers change. The closest I can get is... $id3 =~ /today(\d+)today/; my $ans = $1 * .40; $final = ($ans / 100); $id4 =~ /yesterday(\d+)yesterday/; my $ans2 = $2 * .40; $final2 = ($ans2 / 100); $id5 =~ /this(\d+)this/; my $ans3 = $3 * .40; $final3 = ($ans3 / 100); $id6 =~ /last(\d+)last/; my $ans4 = $4 * .40; $final4 = ($ans4 / 100); { print "Content-Type: text/html\n\n"; print < Original Number: $1 - $2 - $3 - $4
After it's been converted: $ans - $ans2 - $ans3 - $ans4 After being divide by 100: $final - $final2 - $final3 - $final4 which spits out Original Number: 5350 - - - After it's been converted: 2140 - 0 - 0 - 0 After being divide by 100: 21.4 - 0 - 0 - 0 It only messes with the last5350last, even if I only have the code that should mess with today408today.