On Wed, 2006-01-11 at 17:30 +1100, Kim Ryan wrote:
> OK, will explain this more clearly. I want to add some custom variables
> to an existing template, and am using the approach of adding a sub and
> exporting it:
>
> sub todays_list : Exported {
> my ($self, $r ) = @_;
> my $some_var = 'some value';
> $r->objects( $self->search( some_var => $some_var->x) );
> $r->template('list');
> }
>
> That is all fine, except I can't compile because I get and Invalid CODE error
> when the compiler see ': Exported.' The suggested work arounds of wrapping
> BEGIN {} around the sub or calling the sub last don't work.
Kim,
It's probably simplest if you just attach your code for the entire
module or modules (I don't think you have told us whether this is in
your driver or a separate model module). It will be a lot easier to see
what's wrong that way, rather than playing 20 questions :)
Cheers, Dave
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users