>
> The above works perfectly however it doesn't work in my project since I
have all my functions in a seperate file.
> I tried doing this in my page:
>
> [- $subs = $param[0] -]
> [! sub getstatus { return $subs->status } !]
>
> But unfortunately I get the following error message: 'Can't call method
"status" on an undefined value at....'
>

Yes, because $subs will not be defined at the time you call your subroutine.

One possibility is to change it to

[! sub getstatus { return $_[1]->status } !]

and call it like

[- $r -> getstatus ($subs) -]

or you can add your subs object to the request data, so you don't have to
pass it everytime as argument:


[! sub getstatus { return $_[0]->{subs}->status } !]

and call it like

[-
$r -> {subs} = $subs ;
$r -> getstatus  ;
-]

> Is there some other way I can separate my functions from the individual
pages and get an accurate status. Or am I going in the totally wrong
direction and should I instead do things with plain Embperl instead of
EmbperlObject????
>

It depends on what you want to do. From what I hear so far, I think
EmbperlObject is alright for you.

> Is there really no way to force Embperl to Execute the (*) part first?

The Execute order defines where in your output the resulting HTML is places.
So Executeing (*) first changes your output.

> Surely this would make sense for most applications and would make things a
lot simpler. Also it would make it easier to port from plain CGI?

And how do you define where the output goes ?

Suggestions are always welcome to improve Embperl

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to