use warnings; use strict; #Take any function input in the correct format, and turn it into a subroutine. print "Enter a function in the 'expression(x)' format"; chomp(my $function = ); $function = s/x/@_/g sub function{ $function; } my $tobedone = 53; #Example number my $done = &function($tobedone);