Strictly speaking, this is a Perl question, but I am asking it in a Mac-oriented context, and it may be helpful to others on the list right now, so I hope you'll bear with me :) The question is: How do you create new members in a class without using a unique variable for each one? Or, alternatively, how do you refer to an anonymous class member by the value of one of its properties (such as Name, for instance)? This comes up because I'm just starting to write a program to convert tagged text from QuarkXPress to HTML. (For many reasons, I'm using Xtags (<http://www.emsoftware.com/>), rather than XPress Tags for this, but the principles involved here should be the same for either.) In order to keep track of the style sheets used by the paragraphs in this text, I would like to set up a Style_Sheet class, and define each style sheet as a member of that class as I'm reading in the style sheet definitions at the beginning of the tagged file. Then when I'm reading the text paragraphs, I would like to be able to refer to the various properties of the style sheet for that paragraph so I can figure out how to deal with it. I'm trying for something a lot like the way you can use AppleScript to refer to this kind of thing inside QuarkXPress: set theStyle to "Normal" . . . get point size of style sheet theStyle I have made very minor modifications to a class definition given in a book called "Perl 5 How-To" (A very useful book! ISBN 1-57169-058-1, by Mike Glover, et al.) and it works just fine, but so far I have had to use a new variable for each new style sheet, which just won't work in the long run. Here's the code I've got so far: use strict; package Style_Sheet; sub new { my $class = shift; my $self = {}; if (defined $_[0]) { $self->{Name} = shift; } if (defined $_[0]) { $self->{Size} = shift; } if (defined $_[0]) { $self->{Font} = shift; } bless $self, $class; } sub Name { my $self = shift; $self->{Name}; } sub Size { my $self = shift; $self->{Size}; } sub Font { my $self = shift; $self->{Font}; } package main; my $Style1 = new Style_Sheet("Body_Text", 12, "Times"); my $Style2 = new Style_Sheet("Head", 18, "Helvetica"); print "Style sheet \"", $Style1->Name, "\" has a point size of ", $Style1->Size, " and uses ", $Style1->Font, ".\n"; print "Style sheet \"", $Style2->Name, "\" has a point size of ", $Style2->Size, " and uses ", $Style2->Font, ".\n"; exit(0); As you can see, I have to have a hard-coded reference variable name ($Style1, $Style2, etc.) for each new style sheet object, when what I'd like to be able to do is refer to it indirectly by setting the value of a scalar to the variable name, and then using that as a reference. I tried setting up a scalar to contain the name of a style sheet, and then referencing/dereferencing it, but I was told this wasn't allowed. Is there a way to do this in Perl? Richard __________________________ Richard Pfeiffer <pfeiffer@well.com> Publishing Automation/Database Consulting/Book Production BMUG Scripting SIG -- Next Meeting: Monday 4/21/97, BMUG offices @ 6:00 p.m.