Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: 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:44 UTC ( #1039191=note: print w/replies, xml ) Need Help??


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

From my slightly cargo-culty perspective on what's going on here, I think that bug looks like it - especially given that non-bitwise ops don't seem to show the weirdness, and since nor does putting the constant string in a variable before doing the &:

use Devel::Peek; use strict; no warnings "numeric"; sub xx { my $arg = shift; my $const = ""; print "(" . ($arg & $const) . ")\n"; } xx("ff"); xx(7); xx("ff");
This code gives:
SV = PV(0x100802558) at 0x1008474e0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x1002074f0 "ff"\0 CUR = 2 LEN = 8 () SV = PVIV(0x100803c58) at 0x1008474e0 REFCNT = 1 FLAGS = (PADMY,IOK,pIOK) IV = 7 PV = 0x1002074f0 "ff"\0 CUR = 2 LEN = 8 (0) SV = PVIV(0x100803c58) at 0x1008474e0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) IV = 7 PV = 0x1002074f0 "ff"\0 CUR = 2 LEN = 8 ()
  • Comment on Re^3: Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: Mystery state (possibly about whether an argument is numeric?) being maintained across calls to a sub
by Anonymous Monk on Jun 16, 2013 at 11:26 UTC

    This code gives:

    Not without a call to Dump it doesn't :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039191]
help
Chatterbox?
[Corion]: (that module has been deprecated by its author already, so that's fair. Although I wonder why the backtracking can't be fixed to handle the formfeeds gracefully)
[choroba]: not enough tuits?
[Corion]: choroba: Yeah, maybe. I'm also unaware of who uses Email:: modules, but that's more my limited horizon of things ;)
[Corion]: Ah - there even is the replacement of Email::Address::XS , by the bug reporter, which hopefully fixes this bug already ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2018-06-20 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (116 votes). Check out past polls.

    Notices?