|
From: LD <lds...@ya...> - 2005-05-03 13:48:14
|
Hi there,
On 03/05/2005, at 9:28 PM, Randal L. Schwartz wrote:
> LD> sub someTemplate { \ <<'EOT'; }
> LD> [% self.CGI.header %]
> LD> [% self.CGI.h1(self.reflect.package) %]
> LD> EOT
> LD> ...I <..> get something like: PKG0x958d0c
>
> Well, that's probably the actual package name of that lightweight
> class.
Possibly - but its real name (e.g., "Main") is properly spat out when
such a definition is within a template file; but not with the above.
Perhaps it needs detainting to work...
> local $_ = $self->shortname;
> tr/_/ /;
tr/::/ /;
> s/\b([a-z])/\U$1/g;
Ahh, yep - that works. Cheers.
> "This (and other) tips will be found in the forthcoming
> CGI::Prototype::Cookbook, coming soon to a CPAN near you. Offer void
> where prohibited."
No doubt it'll be a useful resource...
with regards,
--
LD
|