in reply to extract an operator from a string

You could use the eval function:
my $calc="1+2"; print eval ($calc) ."\n";
Prints 3. (eval will execute any perl code passed to it, so you should read up on taint checking and the -T switch).