David Dyck wrote:
I guess __PACKAGE__ is one of those constants that  O::Deparse
can't regenerate the correct source for, right?  Seems like
they are both READONLY but __PACKAGE__ is "FAKE".

There's nothing to regenerate; the tokenizer has already eaten the original contents and replaced it with PL_curstash:

...toke.c:4350 or so...

        case KEY___PACKAGE__:
            yylval.opval = (OP*)newSVOP(OP_CONST, 0,
                                        (PL_curstash
                                         ? newSVhek(HvNAME_HEK(PL_curstash))
                                         : &PL_sv_undef));
            TERM(THING);


John

p.s. is this _really_ necessary:

          if (name[1] == '_' &&
              name[2] == 'P' &&
              name[3] == 'A' &&
              name[4] == 'C' &&
              name[5] == 'K' &&
              name[6] == 'A' &&
              name[7] == 'G' &&
              name[8] == 'E' &&
              name[9] == '_' &&
              name[10] == '_')
          {                                       /* __PACKAGE__ */
            return -KEY___PACKAGE__;
          }

i.e. isn't strEQ going to shortcircuit just as fast as individual char tests???

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

Reply via email to