Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Crock involving $^ Message-ID: <1991Feb12.180057.20540@uvaarpa.Virginia.EDU> Date: 12 Feb 91 18:00:57 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 40 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; } 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... Dale Worley Compass, Inc. worley@compass.com -- The United States has entered an anti-intellectual phase in its history, perhaps most clearly seen in our virtually thought-free political life. -- David Baltimore