[Templates] Template::Plugin::Class question
[prev]
[thread]
[next]
[Date index for 2004/05/11]
Hi all,
I'm working with Template::Plugin::Class in order to use a thirdy part module
(by avoiding to write specific Plugin).
I've a trouble in calling method of proxed classes where I must pass an hash as
argument.
For example:
[% use foo = Class(Foo) %]
[% foo.some_method(key1 => 'value1', key2 => 'value2') %]
Since it isn't alway possible (and convenient) to fix thirdy parts methods, for
example with:
sub some_method {
my $self = shift;
my %args = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
...
}
a possible workaround is to call 'some_method' with:
[% foo.some_method('key1','value1','key2','value2') %]
but it doesn't sound too good for me... :-)
My (general) question is: there is a way to pass hashes in order to have them
(inside subs) non as hash ref?
Thanks in advance (also sorry in advance if this question has been already
posted in this list, even if I searched over archive before posting... :-)
by
- Enrico
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
[Templates] Template::Plugin::Class question
Enrico Sorcinelli 11:38 on 11 May 2004
|