in reply to possible to assign symbolic references?

If you want names, then you are looking for a hash.

$currentTag->{class} = 'Widget'; #for exampleYou can then pass $currentTag around, or push it onto an array of children of the parent tag, or whatever you need to do.

Just say my $currentTag = {}; when you start a new tag, or my %currentTag = (); if you prefer.

Then you can do push @{$parentTag->{children}}, $currentTag; or push @{$parentTag{children}}, \%currentTag; respectively.

Replies are listed 'Best First'.
Re^2: possible to assign symbolic references?
by Argel (Prior) on Sep 22, 2010 at 20:08 UTC
    Yeah, I agree. Whenever I want names like this I just resort to hashes. They are easy to understand for just about anyone who reads the code and do not introduce any special magic that will eventually come back to bite you.

    Elda Taluta; Sarks Sark; Ark Arks