develooper Front page | perl.perl5.porters | Postings from August 2012

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
From:
Abigail
Date:
August 28, 2012 09:54
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
20120828165705.GE16987@almanda
On Tue, Aug 28, 2012 at 11:58:26AM -0400, David Golden wrote:
> On Tue, Aug 28, 2012 at 9:06 AM, Dave Mitchell <davem@iabyn.com> wrote:
> 
> >
> > Depending on how the constant value is is defined, it may be IOK or POK:
> > by uncommenting the print debug, we change FOO from integer to string.
> 
> 
> I was thinking more of the truly constant case, where constants are
> providing more readable test values:
> 
>     use constant OK => 200;
> 

But that's not as constant as one may think:

    use Devel::Peek;

    use constant OK => 200;

    Dump (OK);
    my $v =  OK . $";
    Dump (OK);

    __END__
    SV = IV(0x100838778) at 0x100838780
      REFCNT = 4
      FLAGS = (PADMY,IOK,READONLY,pIOK)
      IV = 200
    SV = PVIV(0x10080a810) at 0x100838780
      REFCNT = 4
      FLAGS = (PADMY,IOK,POK,READONLY,pIOK,pPOK)
      IV = 200
      PV = 0x10022a180 "200"\0
      CUR = 3
      LEN = 16


Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About