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: defined() - bug or feature? Message-ID: <126304@uunet.UU.NET> Date: 22 Mar 91 21:53:10 GMT References: <1991Mar21.142935.11333@bmers145.bnr.ca> Organization: UUNET Communications Services, Falls Church, VA Lines: 16 In article <1991Mar21.142935.11333@bmers145.bnr.ca> friedman@chekov.UU.NET (Barry Friedman) writes: > I've noticed the following non-intuitive behaviour of 'defined()': > When a variable is used in a string it becomes defined. This is a tricky situation. In LISP, mentioning an atom as a data object actually intern's it, but does not bind it. You cannot use the value cell until you set it to something. However, in perl, variables "spring to life" on reference, with "null or zero values as appropriate". In order to accommodate this, variables must become defined. I really don't like using defined for this reason, and shy away from it. -- [rbj@uunet 1] stty sane unknown mode: sane