For those who might be interested, I had to create the formats "on the
fly" like so:
$format="format CUSTOMER_REPORT=
";
and then
eval $format
later in my subroutine. Of course, all $ signs had to be protected too
but it seems to work and I'm in a hurry..
Simply "require"ing the file with the formats in the derived class
didn't work.
Donncha.
Donncha O Caoimh wrote:
>> Just got my head around Perl OO yesterday (after a lengthy time away
> from trying to figure it out, those O'Reilly books are great!) and I'm
> trying to print to a FORMAT from a derived function.
> I tried the obvious,
> $self->{CUSTOMER_REPORT} = CUSTOMER_REPORT;
> in the base constructor which didn't work (didn't think it would
> though.) but I'd like to know if anyone knows a better way of using
> formats other than including the file in each function, or making them
> global variables. (Is that possible with formats even?)
>
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!