in reply to Re^3: Print Vs Return In a Subroutine
in thread Print Vs Return In a Subroutine
This is exactly the point the question is not clear to me. The question sound a bit like "I'm singing" and "I'm dancing" what's faster? The difference between return value and print out to the screen is less in terms of speed but much more in terms of what are going to do? If you are happy with printing the result of the sub to the screen - go on there is nothing wrong with it and there is also no need to return the result to a caller and print it there. But if you want to collect the results of the calculation and do furher processing maybe an average of multiple runs or save it to the database there is the only way to pass a value back to the caller and printing to a screen is completely useless.