Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!wuarchive!psuvax1!news From: flee@guardian.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.perl Subject: Re: nested packages??? Message-ID: Date: 14 Nov 90 19:59:34 GMT References: <108383@convex.convex.com> Sender: news@cs.psu.edu (Usenet) Organization: Penn State Computer Science Lines: 26 Nntp-Posting-Host: guardian.cs.psu.edu Nested packages don't quite work. package a'b; $c = 3; $a'b'c = 4; print $c; prints 3, but package a'_b; $c = 3; $_a'b'c = 4; print $c prints 4. Apparently, package x'y uses the symbol table %_main{"__x"}{"_y"}, while $x'y'z uses the symbol table %_main{"_x"}{"__y"}. I'd like to see nested packages work right. The applications are endless. For one, I could make enums live in their own namespace if nested packages worked correctly. This is actually a symptom of lazy typing; it's easier to type $color'red instead of $color_red. One thing that's needed is a way of specifying a name relative to the current package. How about, $main'x is an absolute name, but $'main'x is a name relative to the current package. (This feels backwards since Unix filenames follow the opposite rule...) Does this conflict with current practice? $'x currently is the name "x" in the null package. Does anyone use the null package? -- Felix