in reply to passing return value of a function to print
Call the function properly and it works. Note parentheses.
Also I have added use strict; and use warnings; which is highly recommended and would have given you valuable feedback as to what the problem was.use strict; use warnings; print func(); sub func { return "123"; }
Unquoted string "func" may clash with future reserved word ... print() on unopened filehandle func ...
|
|---|