call subroutine in print function

perl

Solution

Sure: `print "Result is: ", calcPercentage($a, $b), "\n";`

Problem

I've got a subroutine: `calcPercentage`. I want to print the value returned by this subroutine. Can I do this in a single line, similar to this: ``` print "Result is: $calcPercentage($a,$b)" ```

Original source

Related problems