We don't bite newbies here... much | |
PerlMonks |
Re: getting wrong valueby AnomalousMonk (Archbishop) |
on Jan 16, 2013 at 01:34 UTC ( [id://1013480]=note: print w/replies, xml ) | Need Help?? |
From the updated OP:
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.
In Section
Seekers of Perl Wisdom
|
|