$result = "And the answer is $var1 (or $var2 percent)"; #### printit( "The answer is %s (or %d percent)" ); sub printit { $format = shift @_; # Passed in to function ...set variables... $result = sprintf( $format, $var1, $var2 ); }