in reply to print subroutine name calls subroutine but with appended 1 number to the output

You're printing "hello" on line 5. But the foo subroutine returns the result from print to the calling line. The problem is that you're printing that result, too. Print returns a true value when successful, evidentally 1 in this case.

Change line 5 to:

return "hello";

and you'll get the results you were looking for.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: print subroutine name calls subroutine but with appended 1 number to the output
  • Download Code