Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Answer: How can I write a function's output to a scalar?

( #182083=categorized answer: print w/ replies, xml ) Need Help??

Q&A > subroutines > How can I write a function's output to a scalar? contributed by Abstraction

As a general rule functions should always return a value not print that value out. Following this rule will avoid problems like this.

But if you don't have the option of modifying the function you'll have to do some trickery with STDOUT.

Comment on Answer: How can I write a function's output to a scalar?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (15)
As of 2014-08-27 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls