in reply to passing return value of a function to print
As an alternative to farang's (++) method: Declare the sub first, then you don't need the parens:
You could also pre-declare a stub, use it, then add the code for the sub:perl -e ' sub f {"123\n"}; print f' # prints '123'
perl -e 'sub f;print f; sub f {"123\n"}'
"The trouble with the Internet is that it's replacing masturbation as a leisure activity."
-- Patrick Murray
|
---|
In Section
Seekers of Perl Wisdom