Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!rbj From: rbj@uunet.UU.NET (Root Boy Jim) Newsgroups: comp.lang.perl Subject: Re: While learning PERL... a suggestion Keywords: perl file learn suggest Message-ID: <119776@uunet.UU.NET> Date: 24 Jan 91 23:44:29 GMT References: <1991Jan21.174520.12207@iwarp.intel.com> <1991Jan21.201845.28080@ux1.cso.uiuc.edu> <1991Jan24.100539.20366@iwarp.intel.com> Organization: UUNET Communications Services, Falls Church, VA Lines: 47 In article <1991Jan24.100539.20366@iwarp.intel.com> merlyn@iwarp.intel.com (Randal L. Schwartz) writes: >The name spaces are separate in the ordinary sense, but the * operator >is not an ordinary operator. :-) > >I hope Larry will forgive me for the following. It's probably close >enough for jazz, but Larry will cringe at the description. I hope not. >Think of *FOO as the internal representation of the symbol "FOO" in >the program, in *whatever* form it is used: &FOO, $FOO, %FOO, @FOO, >and FOO as a filehandle. When you say *BAR = *FOO, you are really >saying that BAR can be used anywhere that FOO can be used with >identical results. It doesn't matter if there's an intermediate step: >you could say $a = *FOO then *BAR = $a. I'm jumping in here because of a phone conversation I had with merlyn before he left. In LISP, a symbol is an object. It has four "cells": a value, a function, a property list, and a print name. Think of PERL symbol as having many cells also: scalar, array, assoc, label, a subroutine (Larry, you used a dirty word!), & file handle. A similar concept exists in C++, the reference operator. So *FOO really *IS* the pointer to the symbol itself. It's a pity that Larry decided to swap the meaning of & and *. Because then he wouldn't have had to include these in "Here is what C has that perl doesn't". It is probably too late to right this wrong. >By the way, I just got home from Uniforum...My hand is tired. :-) Maybe you should have taken your woman with you :-) > It was great. 300 books sold and signed within 2 hours. Oh yeah. >print do {{ redo unless "Just another Perl hacker,"; }} # huh? :-) >-- >/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ >| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | >| merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | >\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/ -- Root Boy Jim Cottrell Close the gap of the dark year in between