Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: sort Message-ID: <9384@jpl-devvax.JPL.NASA.GOV> Date: 1 Sep 90 22:16:50 GMT References: <1990Aug21.224327.20194@iwarp.intel.com> <1990Aug22.111018.3329@comp.vuw.ac.nz> <105536@convex.convex.com> <1990Aug29.191454.23527@iwarp.intel.com> <9337@jpl-devvax.JPL.NASA.GOV> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 57 In article flee@guardian.cs.psu.edu (Felix Lee) writes: : >I just had the weirdest thought. The ne and != operators should maybe : >return -1 or +1 when the operands aren't equal. : : Call it something else, like "cmp" and "<=>" and I'll take it. I've : had vague yearnings for a comparison operator for a long time. I like those, much though I loathe 3-character operators. They feel right and are easy to remember. While we're redesigning the language, I've been considering another problem. Subroutines right now have no way to determine what package they were called from, which makes it difficult to install variables into the correct package. In addition, the debugger needs to know the file and line number a routine was called from. I propose a function "caller", which does this: ($package, $file, $line) = caller; This would be easy to implement--I already keep a pointer to the current statement, and the current statement contains this info. It would merely entail making the saved current statement pointer available to the subroutine. Other items sneaking in at the last moment. Filetests -M, -A and -C will return the file's age in days (possibly fractional) at the time the script started. This will make it much easier to write middle-of-the-night skulkers. The tr/// function now has modifier c, d and s. c complements the searchlist, d deletes any characters in searchlist WITHOUT a replacement in replacementlist, and s squashes multiple contiguous occurrences of replacementlist characters to one occurence. Chip Salzenberg sent me a complete patch to add System V IPC (msg, sem and shm calls), so I added them. If that bothers you, you can always undefine them in config.sh. :-) Lessee... Oh yeah. There's a scalar() pseudo-function call that merely supplies a scalar context in the middle of a list. I know you can do it by saying OP . "", but it's better documentation and more efficient. So you can say things like local($nextline) = scalar(); I don't see a need for an operator to supply an array context. I'm also supplying sysread and syswrite as direct hooks to the read and write system calls, for those times when you just have to get past standard I/O. Some of these aren't even implemented yet, but I know I can get them done by the time the book comes out... :-) Holler quick if any of this seems like a tragic mistake. I already listened to you on <=> and cmp. I'm not unreasonable *all* the time. Larry