Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: getting wrong value

by AnomalousMonk (Canon)
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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2016-10-27 13:54 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (363 votes). Check out past polls.