Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Perl question.., @INC questions< Next Oldest | Next Newest >
NewDude Offline





Group: Members
Posts: 150
Joined: Feb. 2006
Posted: May 03 2006,19:20 QUOTE

I am trying to get a Perl program to run.  The @INC global is pointing to another path than where my perl modules are.

The app updates my dynamic dns with my new ip.  

I installed XAMPP which comes with Perl.  

When I try to execute the perl app (perl ipUpdate.pl)

It comes back saying it Can't locates Sys::Hostname modules.  Then it has a bunch of paths.  none point to the

/opt/lampp/lib/perl5/5.8.7/    

I think this is kind of weird since XAMPP people include perl with their package, but didn't update the @INC global variable with their default.

How do I update the @INC or the perl5lib path with the correct on and keep it perment.?? Do I need to update an environment variable in Linux or something...
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: May 03 2006,21:43 QUOTE

I think this is kind of weird since XAMPP people include perl with their package, but didn't update the @INC global variable with their default.

They did things correctly.  I think when you type perl, you wind up using the perl that comes with dsl.  If you want the xampp perl you need to specify the path.  Try this:

perl -e 'foreach(@INC){print "$_\n"}'

/etc/perl
/usr/local/lib/perl/5.8.0
/usr/local/share/perl/5.8.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8.0
/usr/share/perl/5.8.0
/usr/local/lib/site_perl
.

vs. adding the path before perl:

/opt/lampp/bin/perl -e 'foreach(@INC){print "$_\n"}'

/opt/lampp/lib/perl5/5.8.7/i686-linux
/opt/lampp/lib/perl5/5.8.7
/opt/lampp/lib/perl5/site_perl/5.8.7/i686-linux
/opt/lampp/lib/perl5/site_perl/5.8.7
/opt/lampp/lib/perl5/site_perl
.

I suppose you could always put the lampp directories at the front of your PATH variable and get the same result without always needing to add the paths.  You could type it in the shell you're working in.

export PATH=/opt/lampp/bin:$PATH

Now you'd get this happening :

perl -e 'foreach(@INC){print "$_\n"}'

/opt/lampp/lib/perl5/5.8.7/i686-linux
/opt/lampp/lib/perl5/5.8.7
/opt/lampp/lib/perl5/site_perl/5.8.7/i686-linux
/opt/lampp/lib/perl5/site_perl/5.8.7
/opt/lampp/lib/perl5/site_perl
.

That does what you want as well, but if it's just one or two lines why not leaves things like they are and add the path in front the few times you need to.
Back to top
Profile PM 
NewDude Offline





Group: Members
Posts: 150
Joined: Feb. 2006
Posted: May 04 2006,16:38 QUOTE

clacker,
   First off, thanks for replying.

Second, I had no idea perl came with DSL.  I am running DSL 2.3 on this machine I have as my web server.  

I guess it doesn't matter which perl I use.  

One thing I did do was look at one of the paths perl (I guess the DSL one) displayed and I copied the Hostname.pm to the directory, but still got the error.  

I will mess with it tonight, maybe I will have some luck now that you have helped.  

I will post my results.

Thanks
Back to top
Profile PM 
2 replies since May 03 2006,19:20 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Perl question..

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code