Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub

by BrowserUk (Pope)
on Jun 15, 2013 at 14:35 UTC ( #1039128=note: print w/ replies, xml ) Need Help??


in reply to Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub

Can anyone shed some light on why this is happening?

Yes. You :) Use Devel::Peek on $arg in the subroutine before and after you assign to it. Eg:

sub xx { my $arg; Dump( $arg ); $arg = shift; Dump( $arg ); print "(" . ($arg & "") . ")\n"; }

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub
Download Code
Re^2: Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub
by cheesestraws (Novice) on Jun 16, 2013 at 09:47 UTC
    Thankyou! Apparently I have managed to miss this tool entirely in my perl-ing to date.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-04-17 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (453 votes), past polls