The first line you don't understand is creating a new instance of the class HTML::TokeParser. new() is, by common convention, the method that returns a new instance of a class.$foo->[0] is dereferencing an arrayref $foo->{bar} is dereferencing a hashref $foo->(@blah) is dereferencing (and invoking) a function-ref $foo->bar is calling the method "bar" that is defined in the class tha +t $foo has been [bless]'ed into.
The second line is an if-else statement. It can be rewritten as such:
Once you understand that $token->[0] is treating $token as a reference to an array and is getting the zero-th element, the other two parts shouldn't be that hard.my $text_index; if ($token->[0] eq 'T') { $text_index = 1; } else { $text_index = -1; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In reply to Re: Script (ovid's) explanation
by dragonchild
in thread Script (ovid's) explanation
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |