You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by alan milligan <al...@hotmail.com> on 2001/09/03 08:23:32 UTC

so whats different about Inline????

Hi,

Two simple and supposedly equivalent scripts follow:

Script 1: test.pl
##############
use Balclutha::User;

my $user = Balclutha::User->login($ARGV[0], $ARGV[1]);
if (defined $user) {
  print join ' ', $user->name, ' has groups ', $user->groups, "\n";
}
else {
  print "invalid user/pwd\n";
}

Script 2: test.epl
##############
<!DOCTYPE HTML PUBLIC "-//W3C//DTable HTML 4.01 Transitional//EN">
<html>
  <head>
    <link rel="stylesheet" href="/balclutha.css">
  </head>
[!
use Balclutha::User;
!]
    <body>
[*
my $user = Balclutha::User->login($fdat{u},$fdat{p});
if (defined $user) {
*]
User: [+ $user->name +] has groups [+ $user->groups +]<br>
[* } else { *]
Invalid User/Pwd<br>
[* } *]
    </body>
</html>


Now for the test ........

[root@mistress perl]# perl test.pl alan alan01
alan  has groups  alan root web cvs

[root@mistress perl]# embpexec.pl test.epl 'u=fortress&p=fortress'
[4863]ERR:  24: Line 1: Error in Perl code: Undefined subroutine 
&Balclutha::Implementations::CourierUser::_getGroups called at 
Balclutha/Implementations/CourierUser.pm line 27.
<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD><BODY bgcolor="#FFFFFF">
<H1>Internal Server Error</H1>
The server encountered an internal error or misconfiguration and was unable 
to complete your request.<P>
Please contact the server administrator,  and inform them of the time the 
error occurred, and anything you might have done that may have caused the 
error.<P><P>
[4863]ERR:  24: Line 1: Error in Perl code: Undefined subroutine 
&amp;Balclutha::Implementations::CourierUser::_getGroups called at 
Balclutha/Implementations/CourierUser.pm line 27.<p>
Offline HTML::Embperl 2.0b3 [Mon Sep  3 07:35:53 2001]<P>
</BODY></HTML>

One or more DATA sections were not processed by Inline.




I am baffled as to why there is an undefined subroutine in the embpexec.pl 
invokation (and in the mod_perl request for that matter...).

The Balclutha::User class has amongst supported implementations a 
Balclutha::Implementations::CourierUser object which it delegates requests 
to, a simple letter-envelope OO paradigm.  All the symbols for this are 
correctly obtained, the test.pl script verifies this.

The Balclutha::Implementations::CourierUser package uses the Inline package 
to wrap some grubby C code which does the work.  The _getGroups call is one 
of these 'private' functions.

The following statement inside this package,

use Inline (Config =>
               DIRECTORY => '/usr/local/apache/_Inline',
               ENABLE => 'UNTAINT');

indicates where all these symbols are compiled to and may be found (and 
indeed they are ...).

I have used Perl XS/SWIG over the years, but this is my first foray into 
Inline (which is remarkably simple to use).  To my knowledge an inline'd 
package may be treated like all other Perl packages.

Does anyone know what is at issue and how to correct this untoward 
behaviour?

Cheers, Alan





_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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


Re: so whats different about Inline????

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

I don't have used Inline so far. What comes to my mind is, that Inline
creates some helperfiles in the filesystem (it has to compile your C code to
a library and load it afterwards). Maybe there is a problem with file
permission, so these files can't be read. When running under Apache you
access these files as a different user. Make sure that these files are
accessable by the Apache user.

Gerald

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

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

----- Original Message -----
From: "alan milligan" <al...@hotmail.com>
To: <em...@perl.apache.org>
Sent: Monday, September 03, 2001 6:23 AM
Subject: so whats different about Inline????


> Hi,
>
> Two simple and supposedly equivalent scripts follow:
>
> Script 1: test.pl
> ##############
> use Balclutha::User;
>
> my $user = Balclutha::User->login($ARGV[0], $ARGV[1]);
> if (defined $user) {
>   print join ' ', $user->name, ' has groups ', $user->groups, "\n";
> }
> else {
>   print "invalid user/pwd\n";
> }
>
> Script 2: test.epl
> ##############
> <!DOCTYPE HTML PUBLIC "-//W3C//DTable HTML 4.01 Transitional//EN">
> <html>
>   <head>
>     <link rel="stylesheet" href="/balclutha.css">
>   </head>
> [!
> use Balclutha::User;
> !]
>     <body>
> [*
> my $user = Balclutha::User->login($fdat{u},$fdat{p});
> if (defined $user) {
> *]
> User: [+ $user->name +] has groups [+ $user->groups +]<br>
> [* } else { *]
> Invalid User/Pwd<br>
> [* } *]
>     </body>
> </html>
>
>
> Now for the test ........
>
> [root@mistress perl]# perl test.pl alan alan01
> alan  has groups  alan root web cvs
>
> [root@mistress perl]# embpexec.pl test.epl 'u=fortress&p=fortress'
> [4863]ERR:  24: Line 1: Error in Perl code: Undefined subroutine
> &Balclutha::Implementations::CourierUser::_getGroups called at
> Balclutha/Implementations/CourierUser.pm line 27.
> <HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD><BODY bgcolor="#FFFFFF">
> <H1>Internal Server Error</H1>
> The server encountered an internal error or misconfiguration and was
unable
> to complete your request.<P>
> Please contact the server administrator,  and inform them of the time the
> error occurred, and anything you might have done that may have caused the
> error.<P><P>
> [4863]ERR:  24: Line 1: Error in Perl code: Undefined subroutine
> &amp;Balclutha::Implementations::CourierUser::_getGroups called at
> Balclutha/Implementations/CourierUser.pm line 27.<p>
> Offline HTML::Embperl 2.0b3 [Mon Sep  3 07:35:53 2001]<P>
> </BODY></HTML>
>
> One or more DATA sections were not processed by Inline.
>
>
>
>
> I am baffled as to why there is an undefined subroutine in the embpexec.pl
> invokation (and in the mod_perl request for that matter...).
>
> The Balclutha::User class has amongst supported implementations a
> Balclutha::Implementations::CourierUser object which it delegates requests
> to, a simple letter-envelope OO paradigm.  All the symbols for this are
> correctly obtained, the test.pl script verifies this.
>
> The Balclutha::Implementations::CourierUser package uses the Inline
package
> to wrap some grubby C code which does the work.  The _getGroups call is
one
> of these 'private' functions.
>
> The following statement inside this package,
>
> use Inline (Config =>
>                DIRECTORY => '/usr/local/apache/_Inline',
>                ENABLE => 'UNTAINT');
>
> indicates where all these symbols are compiled to and may be found (and
> indeed they are ...).
>
> I have used Perl XS/SWIG over the years, but this is my first foray into
> Inline (which is remarkably simple to use).  To my knowledge an inline'd
> package may be treated like all other Perl packages.
>
> Does anyone know what is at issue and how to correct this untoward
> behaviour?
>
> Cheers, Alan
>
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> ---------------------------------------------------------------------
> 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