Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Crock involving $^ Message-ID: <11412@jpl-devvax.JPL.NASA.GOV> Date: 12 Feb 91 20:38:38 GMT References: <1991Feb12.180057.20540@uvaarpa.Virginia.EDU> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 50 In article <1991Feb12.180057.20540@uvaarpa.Virginia.EDU> worley@compass.com writes: : Here's a patch to make $^ behave somewhat more civilly. When it is : installed, $^ only absorbs the next character if it is a letter or one : of @[\]^_. That should fix most of the strange behavior. This still : leaves the ambiguity in $^^ (it is interpreted as "variable : control-^), but that can be lived with. : : *** toke.c.orig Tue Feb 12 11:43:22 1991 : --- toke.c Tue Feb 12 11:46:09 1991 : *************** : *** 1466,1472 **** : else : d[1] = '\0'; : } : ! if (*d == '^' && !isspace(*s)) : *d = *s++ & 31; : return s; : } : --- 1466,1473 ---- : else : d[1] = '\0'; : } : ! if (*d == '^' && : ! (('@' <= *s && *s <= '_') || ('a' <= *s && *s <= 'z'))) : *d = *s++ & 31; : return s; : } Beware. 4.0 will only allow A-Z and [\]^_?. Notice no @ or lower case. I'd have to rewrite the symbol table code to allow an identifier containing a null, and I don't fancy doing that right now. It's restricted to upper case so's I can just say *s ^ 64, me being lazy and all. The lines read: if (*d == '^' && (isupper(*s) || index("[\\]^_?",*s))) *d = *s++ ^ 64; : Root Boy Jim writes: : On a PDP-11, I would guess that $^f would be the switch register. : : TECO fiend! But since Perl claims Basic-Plus as one of its : (illegitimate) parents, it sounds reasonable. I remember that the : only peek that didn't require privileges was PEEK(-56), which returned : the switch register... Yep. Did you ever try writing a run-time system with no documentation? That was fun. Disassembling the operating system helped, a little. "Who stomped on my FIRQB?!!??!!" Larry