From: Chad Perrin Date: 2005-12-31T07:26:46+09:00 Subject: Re: What is the difference between :foo and "foo" ? On Sat, Dec 31, 2005 at 12:55:55AM +0900, Austin Ziegler wrote: > > Hopefully that's a bit clearer. It's not that different from Perl > barewords. My understanding is that barewords are not persistent atomic elements of code the way symbols are -- they are immediately slotted into some other syntactic meaning by context, and if context doesn't suggest any meaning in particular, they're assumed to be strings. In general, what this means is that if you use a word without hints to what it is, it's a subroutine if you have defined a subroutine by that name, and otherwise it's just a shorthand way of using a literal string by omitting quotes. To compare a symbol to that seems to be short-changing the potential uses of symbols. There is a Symbol module for Perl, which I haven't used and unfortunately don't know much about, but my understanding is that it's pretty limited in comparison with Lisp (or, now, Ruby) symbols, in that it's just a wrapper for globs. It seems to me that if you want to draw a comparison between Ruby symbols and something in Perl, globs are the better choice, in fact, as far as the way they "act" under pressure, though they are limited in that where a Ruby symbol is "a name" for anything, a Perl glob is "a name" only within a filehandle context. I haven't really thought about it before this, but I'm actually kinda disappointed that Perl doesn't have a fully operational death star . . . err, I mean that it doesn't have anything like symbols, except in a very limited sense. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] unix virus: If you're using a unixlike OS, please forward this to 20 others and erase your system partition.