Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Abstraction (Friar)
on Jul 16, 2002 at 14:01 UTC ( #182083=categorized answer: print w/replies, xml ) Need Help??

Q&A > subroutines > How can I write a function's output to a scalar? - Answer 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-06-23 15:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (549 votes). Check out past polls.