Include problem
This is a multi-part message in MIME format.
--===============0586366101==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C78B78.C7E05E68"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C78B78.C7E05E68
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hello:
I am attempting to access a module in another file and get an error
stating the module cannot be found.
My main module is simply:
require 'Telnet.pm';
use Net::Telnet ();
$t =3D new Net::Telnet (Timeout =3D> 10,
Prompt =3D> '/bash\$ $/');
The first line was created with the 'Require Module' tab. The Telnet.pm
file is in the same directory as my main module but cannot be located.
What is the problem and how do I set an include path in ActivePerl ( if
that is the problem )?
Thanks,
Brenda
------_=_NextPart_001_01C78B78.C7E05E68
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007>Hello:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D908273722-30042007>I am =
attempting to
access a module in another file and get an error stating the module =
cannot be
found.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D908273722-30042007>My =
main module is
simply:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007> require
'Telnet.pm';<BR> use =
Net::Telnet
();</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007> &nbs=
p; $t
=3D new Net::Telnet (Timeout =3D>
10,<BR> =
&=
nbsp;
Prompt =3D> '/bash\$ $/');</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D908273722-30042007>The =
first line was
created with the 'Require Module' tab. The Telnet.pm file is in the same =
directory as my main module but cannot be located. </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D908273722-30042007>What =
is the problem
and how do I set an include path in ActivePerl ( if that is the problem
)?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007>Thanks,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D908273722-30042007>Brenda</SPAN></FONT></DIV></BODY></HTML>
------_=_NextPart_001_01C78B78.C7E05E68--
--===============0586366101==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0586366101==--
Re: Include problem
--===============0323614418==
Content-Type: multipart/alternative; boundary=Apple-Mail-3--33830538
--Apple-Mail-3--33830538
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
Hi Brenda,
Try:
use lib ".";
use Telnet
That should do the trick for you.
Cheers,
Preston.
On 01/05/2007, at 8:42 AM, Brenda Powers wrote:
> Hello:
>
> I am attempting to access a module in another file and get an error
> stating the module cannot be found.
>
> My main module is simply:
>
> require 'Telnet.pm';
> use Net::Telnet ();
> $t = new Net::Telnet (Timeout => 10,
> Prompt => '/bash\$ $/');
>
> The first line was created with the 'Require Module' tab. The
> Telnet.pm file is in the same directory as my main module but
> cannot be located.
> What is the problem and how do I set an include path in ActivePerl
> ( if that is the problem )?
>
> Thanks,
> Brenda
> _______________________________________________
> ActivePerl mailing list
> ActivePerl [at] listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--
Preston de Guise
pdeguise [at] gmail.com
http://www.anywebdb.com
--Apple-Mail-3--33830538
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hi Brenda,<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Try:</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>use lib ".";</DIV><DIV>use =
Telnet</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>That =
should do the trick for you.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Preston.</DIV><DIV><BR><DIV><=
DIV>On 01/05/2007, at 8:42 AM, Brenda Powers wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"> =
<DIV><FONT face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">Hello:</SPAN></FONT></DIV> <DIV><FONT =
face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007"></SPAN></FONT>=A0</DIV> <DIV><FONT =
face=3D"Arial" size=3D"2"><SPAN class=3D"908273722-30042007">I am =
attempting to access a module in another file and get an error stating =
the module cannot be found.</SPAN></FONT></DIV> <DIV><FONT face=3D"Arial" =
size=3D"2"><SPAN class=3D"908273722-30042007"></SPAN></FONT>=A0</DIV> =
<DIV><FONT face=3D"Arial" size=3D"2"><SPAN class=3D"908273722-30042007">My=
main module is simply:</SPAN></FONT></DIV> <DIV><FONT face=3D"Arial" =
size=3D"2"><SPAN class=3D"908273722-30042007"></SPAN></FONT>=A0</DIV> =
<DIV><FONT face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">=A0=A0=A0=A0=A0require =
'Telnet.pm';<BR>=A0=A0=A0=A0=A0=A0=A0 use Net::Telnet =
();</SPAN></FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= A0=A0=A0$t =3D=
new Net::Telnet (Timeout =3D> 10,<BR>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Prompt =3D> =
'/bash\$ $/');</SPAN></FONT></DIV> <DIV><FONT face=3D"Arial" =
size=3D"2"><SPAN class=3D"908273722-30042007"></SPAN></FONT>=A0</DIV> =
<DIV><FONT face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">The first line was created with the =
'Require Module' tab. The Telnet.pm file is in the same directory as my =
main module but cannot be located. </SPAN></FONT></DIV> <DIV><FONT =
face=3D"Arial" size=3D"2"><SPAN class=3D"908273722-30042007">What is the =
problem and how do I set an include path in ActivePerl ( if that is the =
problem )?</SPAN></FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007"></SPAN></FONT>=A0</DIV> <DIV><FONT =
face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">Thanks,</SPAN></FONT></DIV> <DIV><FONT =
face=3D"Arial" size=3D"2"><SPAN =
class=3D"908273722-30042007">Brenda</SPAN></FONT></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; =
">_______________________________________________</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">ActivePerl mailing list</DIV><DIV style=3D"margin-top:=
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A =
href=3D"mailto:ActivePerl [at] listserv.ActiveState.com">ActivePe rl [at] listserv.Ac=
tiveState.com</A></DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">To unsubscribe: <A =
href=3D"http://listserv.ActiveState.com/mailman/mysubs">http ://listserv.Ac=
tiveState.com/mailman/mysubs</A></DIV> </BLOCKQUOTE></DIV><BR><DIV> =
<SPAN class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; =
"><DIV>--</DIV><DIV>Preston de Guise</DIV><DIV><A =
href=3D"mailto:pdeguise [at] gmail.com">pdeguise [at] gmail.com</A></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><A =
href=3D"http://www.anywebdb.com">http://www.anywebdb.com</A></DIV><DIV><BR=
class=3D"khtml-block-placeholder"></DIV><BR =
class=3D"Apple-interchange-newline"></SPAN></SPAN></SPAN> =
</DIV><BR></DIV></BODY></HTML>=
--Apple-Mail-3--33830538--
--===============0323614418==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0323614418==--
RE: Include problem
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of
Preston de Guise
Sent: 01 May 2007 04:16
> To: Brenda Powers
> Cc: activeperl [at] listserv.ActiveState.com
> Subject: Re: Include problem
> =
> On 01/05/2007, at 8:42 AM, Brenda Powers wrote:
> =
> =
> Hello:
> =
> I am attempting to access a module in another file and get an
error stating the module cannot be found.
> =
> My main module is simply:
> =
> require 'Telnet.pm';
> use Net::Telnet ();
> $t =3D new Net::Telnet (Timeout =3D> 10,
> Prompt =3D> '/bash\$ $/');
> =
> The first line was created with the 'Require Module' tab. The
Telnet.pm file is in the same directory as my > main module but cannot
be located. =
> What is the problem and how do I set an include path in
ActivePerl ( if that is the problem )?
> =
> Hi Brenda, =
> =
> Try:
> =
> use lib ".";
> use Telnet
> =
> That should do the trick for you.
Unlikely for two reasons. First, the default Activestate installation
already has "." in the include path ( [at] INC - a quick check with 'perl -V'
will confirm that in case I am wrong). Second, the current directory is
probably not the same as the directory that the script and module live
in.
The special variable $0 contains the name of the script being executed
(see 'perldoc perlvar'), which may contain path information, but a more
reliable to locate the directory you want way is to use FindBin (see
'perldoc FindBin'), for example.
use FindBin qw($Bin);
use lib $Bin;
require Telnet;
Note that the module name is not quoted and has no '.pm' extension. See
'perldoc -f require' for an explanation.
HTH
-- =
Brian Raven =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Atos Euronext Market Solutions Disclaimer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Include problem
--===============0219652645==
Content-Type: multipart/alternative; boundary=Apple-Mail-7--14148456
--Apple-Mail-7--14148456
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
On 01/05/2007, at 6:33 PM, Brian Raven wrote:
>>
>> Hello:
>>
>> I am attempting to access a module in another file and get an
> error stating the module cannot be found.
>>
>> My main module is simply:
>>
>> require 'Telnet.pm';
>> use Net::Telnet ();
>> $t = new Net::Telnet (Timeout => 10,
>> Prompt => '/bash\$ $/');
>>
>> The first line was created with the 'Require Module' tab. The
> Telnet.pm file is in the same directory as my > main module but cannot
> be located.
>> What is the problem and how do I set an include path in
> ActivePerl ( if that is the problem )?
>>
>> Hi Brenda,
>>
>> Try:
>>
>> use lib ".";
>> use Telnet
>>
>> That should do the trick for you.
>
> Unlikely for two reasons. First, the default Activestate installation
> already has "." in the include path ( [at] INC - a quick check with
> 'perl -V'
> will confirm that in case I am wrong). Second, the current
> directory is
> probably not the same as the directory that the script and module live
> in.
Well, I guess that all my current scripts that do this when I'm
developing must be malfunctioning :-) I do however tend to only
execute during development from the directory it comes from though,
so yes, if you execute from another directory, that's not going to
work; I hadn't factored that in. But using PDK I tend to end up
compiling everything and treating it as a binary...
> The special variable $0 contains the name of the script being executed
> (see 'perldoc perlvar'), which may contain path information, but a
> more
> reliable to locate the directory you want way is to use FindBin (see
> 'perldoc FindBin'), for example.
>
> use FindBin qw($Bin);
> use lib $Bin;
> require Telnet;
>
> Note that the module name is not quoted and has no '.pm' extension.
> See
> 'perldoc -f require' for an explanation.
Alternatively, another technique would be to setup your own modules
directory so that you can reliably reference this at all times.
E.g.:
# mkdir /opt/MyPerl/modules
# mkdir /opt/MyPerl/modules/MyPerl
copy Telnet.pm to /opt/MyPerl/modules/MyPerl
then:
use lib "/opt/MyPerl/modules";
use MyPerl::Telnet
(Or some other apropos derivation).
Cheers,
Preston.
--
Preston de Guise
pdeguise [at] gmail.com
http://www.anywebdb.com
--Apple-Mail-7--14148456
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; "><BR><DIV><DIV>On 01/05/2007, at =
6:33 PM, Brian Raven wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"><BLOCKQUOTE =
type=3D"cite"><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN>Hello:</DIV><P style=3D"margin: =
0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0</SPAN><BR =
class=3D"khtml-block-placeholder"></P><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN>I am =
attempting to access a module in another file and get an</DIV> =
</BLOCKQUOTE><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">error stating the module cannot =
be found.</DIV> <BLOCKQUOTE type=3D"cite"><P style=3D"margin: 0.0px =
0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0</SPAN><BR =
class=3D"khtml-block-placeholder"></P><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN>My main =
module is simply:</DIV><P style=3D"margin: 0.0px 0.0px 0.0px 0.0px; =
min-height: 14.0px"><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0</SPAN><BR =
class=3D"khtml-block-placeholder"></P><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN> <SPAN =
class=3D"Apple-converted-space">=A0 =A0 </SPAN>require =
'Telnet.pm';</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 </SPAN>use Net::Telnet =
();</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN> <SPAN =
class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 =A0 =A0 </SPAN>$t =3D =
new Net::Telnet (Timeout =3D> 10,</DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 </SPAN>Prompt =3D> '/bash\$ $/');</DIV><P =
style=3D"margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN><SPAN =
class=3D"Apple-converted-space">=A0</SPAN><BR =
class=3D"khtml-block-placeholder"></P><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN>The first =
line was created with the 'Require Module' tab. The</DIV> =
</BLOCKQUOTE><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Telnet.pm file is in the same =
directory as my > main module but cannot</DIV><DIV style=3D"margin-top:=
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">be =
located.<SPAN class=3D"Apple-converted-space">=A0</SPAN></DIV> =
<BLOCKQUOTE type=3D"cite"><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </SPAN>What is =
the problem and how do I set an include path in</DIV> </BLOCKQUOTE><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">ActivePerl ( if that is the problem )?</DIV> =
<BLOCKQUOTE type=3D"cite"><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; =
"><BR></DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Hi Brenda,<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><BR></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">Try:</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">use lib ".";</DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">use =
Telnet</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">That should do the trick for you.</DIV> =
</BLOCKQUOTE><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Unlikely for two reasons. First, the default =
Activestate installation</DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">already has =
"." in the include path ( [at] INC - a quick check with 'perl -V'</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">will confirm that in case I am wrong). Second, the =
current directory is</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">probably not the same as =
the directory that the script and module live</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">in.</DIV></BLOCKQUOTE><DIV><BR =
class=3D"khtml-block-placeholder"></DIV>Well, I guess that all my =
current scripts that do this when I'm developing must be malfunctioning =
:-)=A0 I do however tend to only execute during development from the =
directory it comes from though, so yes, if you execute from another =
directory, that's not going to work; I hadn't factored that in. But =
using PDK I tend to end up compiling everything and treating it as a =
binary...</DIV><DIV><BR><BLOCKQUOTE type=3D"cite"><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">The special variable $0 contains the name of the =
script being executed</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">(see 'perldoc perlvar'), =
which may contain path information, but a more</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">reliable to locate the directory you want way is to =
use FindBin (see</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">'perldoc FindBin'), for =
example.</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">use FindBin qw($Bin);</DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">use lib =
$Bin;</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">require Telnet;</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Note =
that the module name is not quoted and has no '.pm' extension. =
See</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">'perldoc -f require' for an =
explanation.</DIV></BLOCKQUOTE><DIV><BR =
class=3D"khtml-block-placeholder"></DIV>Alternatively, another technique =
would be to setup your own modules directory so that you can reliably =
reference this at all times.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>E.g.:</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV># mkdir =
/opt/MyPerl/modules</DIV><DIV># mkdir =
/opt/MyPerl/modules/MyPerl</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>copy Telnet.pm to =
/opt/MyPerl/modules/MyPerl</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>then:</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>use lib =
"/opt/MyPerl/modules";</DIV><DIV>use MyPerl::Telnet</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>(Or some other apropos =
derivation).</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Preston.</DIV><DIV><BLOCKQUOT=
E type=3D"cite"></BLOCKQUOTE></DIV><BR><DIV> <SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; =
"><DIV>--</DIV><DIV>Preston de Guise</DIV><DIV><A =
href=3D"mailto:pdeguise [at] gmail.com">pdeguise [at] gmail.com</A></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><A =
href=3D"http://www.anywebdb.com">http://www.anywebdb.com</A></DIV><DIV><BR=
class=3D"khtml-block-placeholder"></DIV><BR =
class=3D"Apple-interchange-newline"></SPAN></SPAN></SPAN> =
</DIV><BR></BODY></HTML>=
--Apple-Mail-7--14148456--
--===============0219652645==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0219652645==--