FAQ
I was rather startled when I tried to do this in my EmbperlObject template.

if ($serviceitem->{status} eq 'CLOSED') {
SWC::WebUtil::RedirectTemp(
($ENV{HTTPS} ? 'https' : 'http') .
"://$ENV{HTTP_HOST}/error.html?msgs=Your+web+mail+account+is+closed."
);
} elsif ($serviceitem->{status} eq '') {
$rval = Execute({ inputfile => 'purchase.html',
errors => \@errors, options => HTML::Embperl::optReturnError, import
=> 0});
} else {
$rval = Execute({ inputfile => '*', errors =>
\@errors, options => HTML::Embperl::optReturnError, import => 0});
}


After that I call
$this->display()
which is a method implemented in both '*' and 'purchase.html'.
However if the second if condition executes, it doesn't call the
method in purchase.html, it calls the one in *. In fact, I
discovered that the code continues to work even if I don't Execute *.
EmbperlObject is doing an implicit import of *.

1. If all I want to do is import the file, what should I do? Not
call Execute? What if there's an error while importing, where would I
trap it?
2. How do I force the methods in purchase.html to get called and the
ones in * to be ignored?
--
Kee Hinckley
http://www.messagefire.com/ Anti-Spam Service for your POP Account
http://commons.somewhere.com/buzz/ Writings on Technology and Society

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org

Search Discussions

  • Gerald Richter at Aug 25, 2003 at 5:40 am
    EmbperlObject is doing an implicit import of *.
    Yes, your $this pointer if always blessed into the '*' file, so your call to
    any method in the '*' file doesn't need an import at all.
    1. If all I want to do is import the file, what should I do? Not
    call Execute? yes
    What if there's an error while importing, where would I
    trap it?
    Normaly the only error should a syntax error which should be eliminated
    during development time. If you still to trap errors either use an Apache
    Error page or put the code in a separate sub and call it via Execute
    ('*#mysub') ;
    2. How do I force the methods in purchase.html to get called and the
    ones in * to be ignored?
    You need to overload the methods in '*', e.g.

    $obj = Execute({ object => 'purchase.html',
    errors => \@errors, options => HTML::Embperl::optReturnError});

    bless $this, ref $obj ;

    Gerald

    --
    Kee Hinckley
    http://www.messagefire.com/ Anti-Spam Service for your POP Account
    http://commons.somewhere.com/buzz/ Writings on Technology and Society

    I'm not sure which upsets me more: that people are so unwilling to accept
    responsibility for their own actions, or that they are so eager to regulate
    everyone else's.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
    For additional commands, e-mail: embperl-help@perl.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupembperl @
categoriesmodperl, perl
postedAug 22, '03 at 8:34p
activeAug 25, '03 at 5:40a
posts2
users2
websiteperl.apache.org

2 users in discussion

Gerald Richter: 1 post Kee Hinckley: 1 post

People

Translate

site design / logo © 2022 Grokbase