On 10/25/05, Kieren Diment <[EMAIL PROTECTED]> wrote:
> I'm trying to rig together a fairly minimal Maypole app to look at
> the contents of a database.  As soon as I try to introduce a :
> Exported method into the app I get invalid code attribute errors like
> this:

This is in the handy PDF tutorial simon wrote (note to self add this
to wiki, as well as link to simons tutorial that has been airdropped
from)...

-------------

use Maypole::Application;
Supporters->setup("...");
# ...
package Supporters::Supporter;
sub total :Exported {
# Calculate the total given by this person,
# and display it
}

This won't work. This is because Supporters::Supporter doesn't know anything
about the :Exported attribute until Supporters->setup has run, and so when Perl
tries to compile the attribute, it dies horribly. Putting BEGIN { }
around the call to
setup is one way to take care of this.

-------------

Hope that helps,

A


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to