my $function = sub { # ...do stuff... }; # Call the sub $function->('param');