Hi Kieren,
I tried your example
sub test : Exported {
#do nothing
}
to the Beer package.
and I always get this error, even when using Maypole::CLI
Couldn't require BeerDB - Invalid CODE attribute: Exported at BeerDB.pm
line 22
BEGIN failed--compilation aborted at BeerDB.pm line 24.
So I'm thinking the problem is perhaps related to my Perl version, which is
quite old at 5.8.0.
Anyhow, am now migrating to RHE and Perl 5.8.7 so hopefully it will clear up
the problem.
Is there a list of minimum version requirements for a Maypole environment?
Could be useful.
Thanks,
Kim
Kieren Diment wrote:
On 11 Jan 2006, at 20:55, Dave Howorth wrote:
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.
I'ts possible that this is a horrible Red Hat / mod-perl related
thing. I had a lot of issues with Red Hat 9 and Maypole a few months
ago which I solved by moving my server to Debian - I couldn't quite
get the recompile bit correctly configured.
Test whether it's your environment by using the basic beerdb and adding
sub test : Exported {
#do nothing
}
to the Beer package.
Run under Maypole::CLI it should be fine, but will crash if there's a
problem with your environment under mod_perl (and maybe cgi - but
I've never used Maypole under CGI). I had this problem with Red Hat,
and OS X 10.3.9.
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
-------------------------------------------------------
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
-------------------------------------------------------
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