in reply to Pattern matching

choroba's solution is perfect. You may also use the substitution operator:
$input_data = s/;$//;
or possibly the chop function if you are sure you want to trim the last character (but I would not really advise this latter solution).