Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
However, as would be obvious to people with more OO experience than I have, when the output sub in a Resume::Text object calls apply_stylesheet (which is defined in the parent Resume package, rather in the child Resume::Text package), the the sub tries to read the data in the __DATA__ section of Resume.pm, not the one in Resume/Text.pm.
You can deal with this problem by further isolating your use of the __DATA__ section behind a method that does a one-time, lazy setup from <DATA>. This turns my $doc = $self->{'parser'}->parse_string(<DATA>); into
This also frees you to override get_stylesheet() in subclasses. How and where get_stylesheet() gets the stylesheet is an implementation detail. A subclass needn't use the __DATA__ section.
In reply to Re: OO and <DATA>
by dws
|
|