Re: Re: Python pyperl
"anand d" <[email protected]> 2 Apr 2006 20:42:22 -0000
| Newsgroups | gmane.comp.web.zope.perl |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart mime message
--===============1571858984==
Content-type: multipart/alternative;
boundary="Next_1144010542---0-203.199.83.120-23255"
This is a multipart mime message
--Next_1144010542---0-203.199.83.120-23255
Content-type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
hi,=0AThankz for the solution.We went through the example in /t and solved =
the problem.We no longer face problem while importing and using standard pe=
rl modules.However we r not able to import and use user-defined perl module=
. We use,=0A=0Aperl.require('User-defined.pm file')=0Aperl.call('Userdefine=
d::function','args')=0A=0AHowever it gives an error of=0Aperl.PerlError: Un=
defined subroutine &main::'function' called.=0A=0A=0ACould please tell wher=
e pyperl searches for the .pm file by default.i.e. in which directory shoul=
d we copy our User-defined perl file so that pyperl finds functions writte=
n in the .pm file=0A=0A=0AAnand=0AGNOWSYS TEAM=0A=0A=0A=0A=0A=0A=0A=0A=0A=
=0A=0AOn Fri, 31 Mar 2006 Felix Schwarz wrote :=0A>=0A>anand d schrieb:=0A=
> >>>> perl.require("POSIX")=0A> > 1=0A> >>>> x=3Dperl.call('import') # imp=
ort is a function in POSIX.pm=0A> > Traceback (most recent call last):=0A> =
> File "<stdin>", line 1, in ?=0A> > perl.PerlError: Undefined subroutine=
&main::import called.=0A>=0A>[fs@workstation pyperl-1.0.1c]$ perldoc POSIX=
| grep import=0A>[fs@workstation pyperl-1.0.1c]$=0A>=0A>I don't see a POS=
IX::import function in perldoc. Please show us your=0A>Perl code you try to=
write. Is it something like:=0A>=0A>----------------=0A>require POSIX;=0A>=
import POSIX;=0A>print clock(),"\n";=0A>----------------=0A>=0A>This can be=
achieved by:=0A>import perl=0A>perl.require("POSIX")=0A>perl.eval('import =
POSIX; print clock(),"\n";')=0A>=0A>If you find bugs, please provide a test=
case for it (see the 't'=0A>directory for examples).=0A>=0A>--=0A>Felix=0A>=
=0A>_______________________________________________=0A>Zope-perl maillist =
- [email protected]=0A>http://mail.zope.org/mailman/listinfo/zope-perl=0A
--Next_1144010542---0-203.199.83.120-23255
Content-type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<P>=0Ahi,<BR>=0AThankz for the solution.We went through the example in /t a=
nd solved the problem.We no longer face problem while importing and using s=
tandard perl modules.However we r not able to import and use user-defined p=
erl module. We use,<BR>=0A<BR>=0Aperl.require('User-defined.pm file')<BR>=
=0Aperl.call('Userdefined::function','args')<BR>=0A<BR>=0AHowever it gives =
an error of<BR>=0Aperl.PerlError: Undefined subroutine &main::'function=
' called.<BR>=0A<BR>=0A<BR>=0ACould please tell where pyperl searches for t=
he .pm file by default.i.e. in which directory should we copy our User-defi=
ned perl file so that pyperl finds functions written in the .pm file<=
BR>=0A<BR>=0A<BR>=0AAnand<BR>=0AGNOWSYS TEAM<BR>=0A<BR>=0A<BR>=0A<BR>=0A<BR=
>=0A<BR>=0A<BR>=0A<BR>=0A<BR>=0A<BR>=0A<BR>=0AOn Fri, 31 Mar 2006 Felix Sch=
warz wrote :<BR>=0A><BR>=0A>anand d schrieb:<BR>=0A> >>=
;>> perl.require("POSIX")<BR>=0A> > 1<BR>=0A> >=
>>> x=3Dperl.call('import') # import is a function in POSIX.pm<BR>=
=0A> > Traceback (most recent call last):<BR>=0A> > File=
"<stdin>", line 1, in ?<BR>=0A> > perl.PerlError: Un=
defined subroutine &main::import called.<BR>=0A><BR>=0A>[fs@works=
tation pyperl-1.0.1c]$ perldoc POSIX | grep import<BR>=0A>[fs@work=
station pyperl-1.0.1c]$<BR>=0A><BR>=0A>I don't see a POSIX::import fu=
nction in perldoc. Please show us your<BR>=0A>Perl code you try to write=
. Is it something like:<BR>=0A><BR>=0A>----------------<BR>=0A>req=
uire POSIX;<BR>=0A>import POSIX;<BR>=0A>print clock(),"\n";=
<BR>=0A>----------------<BR>=0A><BR>=0A>This can be achieved by:<B=
R>=0A>import perl<BR>=0A>perl.require("POSIX")<BR>=0A>pe=
rl.eval('import POSIX; print clock(),"\n";')<BR>=0A><BR>=0A>=
;If you find bugs, please provide a testcase for it (see the 't'<BR>=0A>=
directory for examples).<BR>=0A><BR>=0A>--<BR>=0A>Felix<BR>=0A>=
<BR>=0A>_______________________________________________<BR>=0A>Zope-p=
erl maillist - [email protected]<BR>=0A>http://mail.zope.or=
g/mailman/listinfo/zope-perl<BR>=0A=0A</P>=0A<br><br>=0A<a href=3D"http://a=
dworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-hom=
e.htm/1507191490@Middle5?PARTNER=3D3"><IMG SRC=3D"http://adworks.rediff.com=
/cgi-bin/AdWorks/sigimpress.cgi/www.rediff.com/signature-home.htm/196305942=
3@Middle5?OAS_query=3Dnull&PARTNER=3D3" BORDER=3D0 VSPACE=3D0 HSPACE=3D0></=
a>=0A
--Next_1144010542---0-203.199.83.120-23255--
--===============1571858984==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Zope-perl maillist - [email protected]
http://mail.zope.org/mailman/listinfo/zope-perl
--===============1571858984==--