Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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
Replies are listed 'Best First'.
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 contemplating the Monastery: (10)
As of 2015-07-30 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls