adding a perl module to CiscoWorks PERL !?

Unanswered Question
Aug 3rd, 2007

I have written a perl script to get some info form LMS and store it into a file. Now I want to SFTP this file onto a network share. I want to implement this in Perl as well but on my solaris box (having the solaris perl installed) I cannot find an according module. When I try to install 'Net-SFTP-Foreign' I have problems because I have the wrong compiler. Now I want to know if it is save to add this module to the CiscoWorks Perl version. Or will I run into problems?

Any other suggestion on how to realize this is pretty welcome!

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (3 ratings)
yjdabear Fri, 08/03/2007 - 11:37

Could you just put the sftp commands in the exec() or system() wrapper in perl, so you can bypass installing the third-party perl modules altogether? Assuming OpenSSH is installed on the box.

Martin Ermel Fri, 08/03/2007 - 11:56

I thought of this also but the sftp is interactive and I think I would need something like an Expect module...

or isn`t this true?

Joe Clarke Fri, 08/03/2007 - 15:36

Do not add any modules to CiscoWorks' Perl as this could mess up upgrades. As an alternative to installing modules, just keep your modules in a local directory, and use perl -I to find them. For example:

perl -I/export/home/marcus/lib/perl

Expect is another way to go. With expect, you could easily just wrap the box's sftp executable. Of course, this will mean writing some TCL code.

Martin Ermel Mon, 08/06/2007 - 07:38

Ok, when I want to keep the module in a local dir can I use CiscoWorks' version of Perl to install the modules?

When I use the 'standard' version of my solaris box (/usr/bin/perl) I have got the following 2 problems:

1) prerequisite failed

2) when I want to install the missing module it cannot be compiled (thats the main problem..)

but I think it should work if I would use CiscoWorks' Perl. But what is the correct command to install the modules with /opt/CSCOpx/bin/perl in a local directory (like /usr/perl5/myCPAN) without running into prolblems with LMS

##### this is an excerpt of what I get when trying to install the modules

bash-2.05# perl Makefile.PL

Checking if your kit is complete...

Looks good

Warning: prerequisite Scalar::Util failed to load: Can't locate Scalar/ in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at (eval 4) line 3.

Warning: prerequisite Test::More failed to load: Can't locate Test/ in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at (eval 5) line 3.

Writing Makefile for Net::SFTP::Foreign


### OK- because of the warnings I want to install List::Util and get the following error...

bash-2.05# perl Makefile.PL

Checking if your kit is complete...

Looks good

Writing Makefile for List::Util

bash-2.05# make

cp lib/List/ blib/lib/List/

cp lib/Scalar/ blib/lib/Scalar/

/bin/perl "-Iinc" -I/usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap -typemap mytypemap Util.xs > Util.xsc && mv Util.xsc Util.c

cc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DPERL_EXT Util.c

/usr/ucb/cc: language optional software package not installed

make: *** [Util.o] Error 1

bash-2.05# make test

cc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DPERL_EXT Util.c

/usr/ucb/cc: language optional software package not installed

make: *** [Util.o] Error 1

bash-2.05# make install

cc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DPERL_EXT Util.c

/usr/ucb/cc: language optional software package not installed

make: *** [Util.o] Error 1


### and according to a sun doc this is due to different versions of compilers (the one used on the solaris box and the one with which the module was generated)

Joe Clarke Mon, 08/06/2007 - 07:43

No, this problem indicates you don't have a compiler installed. You need to install the Sun Forte compiler if you want to use Sun's cc.

If you just want to compile stuff, I recommend checking out Blastwave ( This site makes third-party package management a breeze for Solaris. Here you can find the GNU C compiler, which will allow you to build native Perl modules.

Once you get a good compiler on your server, you can build your Perl modules by specifying an alternate installation prefix:

make PREFIX=/home/marcus/lib/perl

Then when you install the module, it will go where you want it to go. Note: you should do the installation as a non-root user so that modules that are not PREFIX-safe don't corrupt your CiscoWorks installation.

Martin Ermel Tue, 08/07/2007 - 13:54

Oh, it's not me who want to use cc, - it's 'make' who want to use it... (I just want to add a module to my installed version of Perl..;-) )

As I have previously installed a mdoule (libnet-1.19 to get Net::FTP) without a problem I thought I should have all I need- but from what you say (if I understand correct) not every perl module needs a C compiler to get installed.

And now I am at the point that I want to install a perl module that needs a C compiler. And - is that correct? - my 'Sun' Perl wants to use the Forte C compiler (cc) with which my 'Sun' Perl was built. And because I don't have it I will run in that error.

Now, I have the option to get a running (GNU) C compiler (gcc) from e.g. and have to force my 'Sun Perl' to use this compiler instead (gcc instead of cc) along with the Solaris::PerlGcc module to get around some other dependencies as mentioned here:

Or to just get the Forte C compiler (e.g. along with a version of SunStudio)

mhm, I don't like both versions much - but I think I will try the later one to keep it kind of 'homogene'

Joe Clarke Tue, 08/07/2007 - 16:38

If you want to use an alternate C compiler with Perl, just set the CC environment variable. Most modules with honor that.

% setenv CC=/opt/csw/gcc3/bin/gcc

% perl Makefile.PL

% make



This Discussion