load modules that are not part of the perl dist

P

Petterson Mikael

Hi,

I am new to perl.
I am a user of a perl script on solaris.( perl 5.6.1)
Since we are switching to linux we need to run the script with linux
perl (5.6.1). When I try to run the script on linux I get:

use: Command not found
use: Command not found
.......

The script contains:

# Standard includes
#---------------------------------
use Tk;
use strict;
use Tk::Balloon;
use Tk::BrowseEntry;
use Getopt::Long;
use IPC::ClearTool;
use lib "/vobs/rbs/sw/rbssw_tools/perllib";
use guiTools;
use deliverTools;
use ProgressBar;
use Label::Design;
use Label::Base;
use CC;
use SysAdmin qw(getRealName sendReport);
use Tk::pLDialogBox;

use Text::Wrap;
use IO::Handle;
use File::Spec;
use File::Copy;
use File::Temp qw(tempfile);
use POSIX qw(strftime);
use FindBin;
use Trace;
use Tk::CheckEntry;
use Tk::pLDialogMCListBox;
use Tk::pLDialogListBox;
use lib "$FindBin::RealBin/plugin";
use PluginMgr;


Can I download these modules in a local directory
(/home/eraonel/perl-5.6.1) and refer to that in the script? ( I cannot
download the modules and install the in the correct directory
(/app/perl/5.6.1/lib/site_perl/5.6.1).

All hints appreciated.

Cheers,

//mikael
 
J

Josef Moellers

Petterson said:
Hi,

I am new to perl.
I am a user of a perl script on solaris.( perl 5.6.1)
Since we are switching to linux we need to run the script with linux
perl (5.6.1). When I try to run the script on linux I get:

use: Command not found
use: Command not found
......

The script contains:

Try inserting a shebang line here:

#! /usr/bin/perl
# Standard includes
#---------------------------------
use Tk;
use strict;
use Tk::Balloon;
use Tk::BrowseEntry;
use Getopt::Long;
use IPC::ClearTool;
use lib "/vobs/rbs/sw/rbssw_tools/perllib";
use guiTools;
use deliverTools;
use ProgressBar;
use Label::Design;
use Label::Base;
use CC;
use SysAdmin qw(getRealName sendReport);
use Tk::pLDialogBox;

use Text::Wrap;
use IO::Handle;
use File::Spec;
use File::Copy;
use File::Temp qw(tempfile);
use POSIX qw(strftime);
use FindBin;
use Trace;
use Tk::CheckEntry;
use Tk::pLDialogMCListBox;
use Tk::pLDialogListBox;
use lib "$FindBin::RealBin/plugin";
use PluginMgr;


Can I download these modules in a local directory

It's probably a shell compalining rather than perl.
 
P

Petterson Mikael

Josef said:
Try inserting a shebang line here:

#! /usr/bin/perl

I already have the path to perl at the top of myc script.

like this:

#!/app/perl/5.6.1/bin/perl -w
 
S

Sherm Pendley

The FAQ assumes you are building your modules by hand. I think it should
also tell you (or point to someplace that does tell you) how to configure
CPAN so that it builds in a custom directory.

If memory serves, recent CPANs give PREFIX as an example when asking about
standard Makefile.PL options you might want to use for every module.

sherm--
 
J

Jürgen Exner

Petterson Mikael wrote:
[...]
perl (5.6.1). When I try to run the script on linux I get:

use: Command not found
use: Command not found


That's not a Perl error message but probably comes from your shell.
You should investigate why the shell is trying to execute the script instead
of perl. Maybe your shebang line is missing or wrong?

BTW: Didn't today's FAQ posting address exactly this question?
[long list of modules snipped]

Can I download these modules in a local directory
(/home/eraonel/perl-5.6.1) and refer to that in the script? ( I cannot
download the modules and install the in the correct directory
(/app/perl/5.6.1/lib/site_perl/5.6.1).

This Question is Asked Frequently, see "perldoc -q module":
How do I keep my own module/library directory?

jue
 
X

xhoster

Jürgen Exner said:
Petterson Mikael wrote:
[...]
perl (5.6.1). When I try to run the script on linux I get:

use: Command not found
use: Command not found

That's not a Perl error message but probably comes from your shell.
You should investigate why the shell is trying to execute the script
instead of perl. Maybe your shebang line is missing or wrong?

BTW: Didn't today's FAQ posting address exactly this question?
[long list of modules snipped]

Can I download these modules in a local directory
(/home/eraonel/perl-5.6.1) and refer to that in the script? ( I cannot
download the modules and install the in the correct directory
(/app/perl/5.6.1/lib/site_perl/5.6.1).

This Question is Asked Frequently, see "perldoc -q module":
How do I keep my own module/library directory?

The FAQ assumes you are building your modules by hand. I think it should
also tell you (or point to someplace that does tell you) how to configure
CPAN so that it builds in a custom directory. Unfortunately, I can't
remember how I did this, so I can't provided the language.

If no one beats me to it, I'll figure it out again and write it down.

Xho
 
P

Paul Lalli

This Question is Asked Frequently, see "perldoc -q module":
The FAQ assumes you are building your modules by hand. I think it should
also tell you (or point to someplace that does tell you) how to configure
CPAN so that it builds in a custom directory. Unfortunately, I can't
remember how I did this, so I can't provided the language.

When you're first setting up CPAN, you need to NOT allow it to just go
ahead and use all the standard configuration answers. At one point, it
will ask you for arguments to the `perl Makefile.pl` command. At this
point, you need to specify whatever arguments you would give were you
building the module by hand (generally something like
`PREFIX=$HOME/lib`)

If CPAN is already configured, you can alter the configuration from
within the shell by typing
o conf makepl_arg PREFIX=$HOME/lib
If no one beats me to it, I'll figure it out again and write it down.

Well, I started typing before I saw any follow up of yours, so we'll
see which one arrives at various newsservers first. :p

Paul Lalli
 
A

A. Sinan Unur

(e-mail address removed)-berlin.de (Anno Siegel) wrote in
comp.lang.perl.misc: ....
^

That blank is non-standard and looks dangerous to me.

Oh, and all this time, I have been making an effort to put a blank after
#! in my scripts :(

Gotta go fix 'em.

Thanks Anno!

Sinan
 
A

A. Sinan Unur

Well, I started typing before I saw any follow up of yours, so we'll
see which one arrives at various newsservers first. :p

I am feeling left out :) See:

<URL:http://groups-
beta.google.com/group/comp.lang.perl.misc/msg/e8ffed6e17cefe7c>

Sinan
 
X

xhoster

Paul Lalli said:
When you're first setting up CPAN, you need to NOT allow it to just go
ahead and use all the standard configuration answers. At one point, it
will ask you for arguments to the `perl Makefile.pl` command. At this
point, you need to specify whatever arguments you would give were you
building the module by hand (generally something like
`PREFIX=$HOME/lib`)

Ah, yes this is bringing back memories. The main problem I had was in
getting CPAN to set up (as a non-root user) in the first place. The first
time I would get the following message:


: Your configuration suggests that CPAN.pm should use a working
: directory of
: /root/.cpan
: Unfortunately we could not create the lock file
: /root/.cpan/.lock
: due to permission problems.
:
: Please make sure that the configuration variable
: $CPAN::Config->{cpan_home}
: points to a directory where you can write a .lock file. You can set
: this variable in either
: /usr/lib/perl5/5.8.0/CPAN/Config.pm

I can't set this variable there. If I could set it there, I would be
root and therefore I wouldn't have had any permissions problems creating
the file /root/.cpan/.lock in the first place.

: or
: /home/xho/.cpan/CPAN/MyConfig.pm

I can't set it there either, because it doesn't yet exist. It would be
nice if cpan would offer to create a rudimentary copy of this file for me.

As it is, I figured out how to do it after reading a lot of documentation
and fiddling around a lot, then making ~/.cpan/CPAN, and copying the
Config.pm file from the location of `perldoc -l CPAN` into
~/.cpan/CPAN/MyConfig.pm. Then changing that file's
$CPAN::Config->{cpan_home} as suggested. Now CPAN will start, but it
thinks it is already configured (because MyConfig is a copy of an already
configured Config.pm, and not just a rudimentary config file). Read some
more documentation to figure out how to get it to forget about already
being configured.

It isn't all *that* hard for me to figure out and do this stuff, but of
course it would be easier not to have to. I don't want to sound
ungrateful, CPAN is a great tool, but it could be even greater (more
great?) if it were friendlier to non-root people. (But for all I know,
these things have been improved in versions after 5.8.0.)

Well, now that I've gone thoroughly off topic, I'll shut up.

Xho
 
A

Anno Siegel

A. Sinan Unur said:
(e-mail address removed)-berlin.de (Anno Siegel) wrote in


Oh, and all this time, I have been making an effort to put a blank after
#! in my scripts :(

Gotta go fix 'em.

Apparently a blank is more or less tolerated these days. Strictly it
would have to look for "usr/bin/perl" in the local directory " ". I
won't swear to it, but I think old unixes did this.

Anno
 
P

Paul Lalli

It isn't all *that* hard for me to figure out and do this stuff, but of
course it would be easier not to have to. I don't want to sound
ungrateful, CPAN is a great tool, but it could be even greater (more
great?) if it were friendlier to non-root people. (But for all I know,
these things have been improved in versions after 5.8.0.)

I think it must have been. I've setup CPAN.pm on a few non-root
accounts, and I can't ever remember going through the steps you just
listed...

Paul Lalli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top