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 ...
In reply to Re: passing return value of a function to print
by farang
in thread passing return value of a function to print
by perlperlperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |