I'm using HTML::parser which calls a 'start' routine for each start of a tag. Tags are all closed with a call to an 'end' routine (real or simulated for self-closing tags).
So what I'd *like* to do in my parse structure, is to allocate an array for the local vars and alias *names* to the array members for processing in a given 'frame'...like:
Is this hopelessly idealistic, or is this doable? I figure it's *probably* possible if I was willing to assign to each name something like \$local_vars[0], \$local_vars1... and then use the names with double dollar signs, but I wanted to avoid the ugliness...my @local_vars; $#local_vars=5; #(don't like the literal 5, but haven' +t gotten so far as to worry about that yet) push @{$this}->{local_vars}}, \@local_vars; #create space for this ta +g's vars assign_names(qw (open_tag, tagprint, cur_class, cur_id, defines_class, + defines_id), \@local_vars); ## this is the questionable 'magic' part +... # now...can use names as one would use local vars.... if ($open_tag eq 'div' and $cur_class eq 'pager') {...
In reply to possible to assign symbolic references? by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |