Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: getting wrong value

by AnomalousMonk (Abbot)
on Jan 16, 2013 at 01:34 UTC ( #1013480=note: print w/ replies, xml ) Need Help??


in reply to getting wrong value

From the updated OP:

$line2 = capture_stdout($line) ; ... sub capture_stdout() { ... }

The function  capture_stdout() { ... } is prototyped to take no arguments and is called with one argument (which is not used!), but the code is executed in such an order as to avoid prototype checking. I suspect the code is also being run without warnings, thus avoiding the "function name called too early to check prototype..." message.

pvaldes has pointed out the way to explicitly defeat prototype checking, but if you're going to avoid or defeat prototype checking, why bother to use prototyping in the first place?

Please see Prototypes in perlsub and Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen – and then don't use prototypes unless you really need to and really understand their intended usage.


Comment on Re: getting wrong value
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-11-26 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls