Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't locate File/Copy.pm in @INC

2,860 views
Skip to first unread message

Joyce E.Evans

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to
Hello,

I have been using perl for about 2.5 years most of my work
has been in fixing other peoples scripts - reworking them to
do something else or customizing/formatting output to their
a webpage or an email, etc. (why reinvent the wheel you
know) so I wouldn't call myself an expert or anything but I
can usually figure this stuff out now I am trying to
re-write a script and use the FILE::COPY module (instead of
using system calls to copy files which is what had been done
in this script) but it seems the machine I am working on
doesn't support this method and I am at a lost at how to
remedy the situation.

We are using perl, version 5.001, Unofficial patchlevel 1m.
on the machine that I am on (SunOS frankenstein.colorado.edu
5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-250 )


Can anyone tell me how to figure out where/ how to determine
the exact value (which libraries) in @INC which are/aren't
available (the FILE::COPY module should be standard
according to my Programming Perl book) or why else I might
be having this problem.

Also, I tried to run the man page for perldebug but it
apparently isn't installed on this machine. Perl isn't used
much at CU Boulder so I am working in a sort of vacuum when
it comes to expertise on this and don't know what to ask for
or how to ask the system administrator to install so please
be very specific about what I need to have installed - I can
write perl ok but I am no unix system admin. (at least not
yet).

Thanks in advance.
****************************************
Joyce E Evans
University of Colorado at Boulder
Applications and Information Systems
WebCT System Administrator
(303) 735-0216
******************************************

John Porter

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to
In article <37DFEC9B...@rtt.colorado.edu>, Joyce E.Evans wrote:
>
>We are using perl, version 5.001, Unofficial patchlevel 1m.
>on the machine that I am on (SunOS frankenstein.colorado.edu
>5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-250 )

You would do very well to upgrade. That is an extremely old
version of perl. It's not just a matter of bells and whistles:
many bugs have been fixed and many security holes have been
patched. Besides, it sounds like your installation may be
broken; installing the latest version would fix that as well.


>Can anyone tell me how to figure out where/ how to determine
>the exact value (which libraries) in @INC which are/aren't
>available (the FILE::COPY module should be standard
>according to my Programming Perl book) or why else I might
>be having this problem.

To find out where your perl is looking for modules by default,
type
perl -V

This will print out, among other things, the value of @INC.

However, I hope you realize that perl is strictly case-senstive,
and the name of the module in question is File::Copy, not
FILE::COPY. If you get the case of the name wrong, perl
will obviously not find it.

>Also, I tried to run the man page for perldebug but it
>apparently isn't installed on this machine.

If you typed

perldoc perldebug

and got the response

No documentation found for "perldebug".

then your perl installation is probably broken beyond repair.
You need to upgrade.


>I am working in a sort of vacuum when
>it comes to expertise on this and don't know what to ask for
>or how to ask the system administrator to install so please
>be very specific about what I need to have installed - I can
>write perl ok but I am no unix system admin. (at least not
>yet).

If your sysadmin is completely unresponsive, you can build and
install your own copy of perl -- assuming you have a working,
supported C compiler. Neither the standard perl distribution
nor add-on modules you write or get from CPAN have to be
installed in a "public" place like /usr/local. You can install
them in your own account. (Of course, you might go over your
quota if you do...)

hth,

--
John Porter


Joyce E.Evans

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to John Porter
Hi John,

Thanks - I do know perl is case sensitive - the exact line of code I am
having trouble with is

use File::Copy "cp";

my perl -v gives me exactly this (which I looked at before I sent this
inquiry) :


webCT # frankenstein # generic/AUTO_REGISTER>perl -v

This is perl, version 5.001

Unofficial patchlevel 1m.

Copyright 1987-1994, Larry Wall

Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5.0 source
kit.

there is no mention of the value of @INC so I thought there was another
place to determine the value of the @INC array. I will see if upgrading /
reinstalling is an option.

Thanks!

John Porter wrote:

****************************************

Bryan Thale

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to Joyce E.Evans
"Joyce E.Evans" wrote:

> Can anyone tell me how to figure out where/ how to determine
> the exact value (which libraries) in @INC which are/aren't
> available (the FILE::COPY module should be standard
> according to my Programming Perl book) or why else I might
> be having this problem.
>

Don't know if this was just the typing convention you used in your post
or not, but the library module should be File::Copy and not all caps.

HTH,
Bryan.

--
Bryan Thale
Motorola Labs, Networking and Infrastructure Research
mailto:th...@rsch.comm.mot.com


Tom Phoenix

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to
On Wed, 15 Sep 1999, Joyce E.Evans wrote:

> I am trying to re-write a script and use the FILE::COPY module

That would be File::Copy. Case is significant, of course.

> We are using perl, version 5.001, Unofficial patchlevel 1m.

When that version of Perl was current, moviegoers were still holding their
breath, waiting for the release of "Waiting to Exhale". You should
probably (ask your sysadmin to) install a version of perl that's a little
newer, either 5.004_05 or 5.005_03. Good luck!

--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/


Joyce E.Evans

unread,
Sep 16, 1999, 3:00:00 AM9/16/99
to Joyce E.Evans
Hello,

thanks for the many responses - I am VERY aware that case makes
a difference and I am using File::Copy not FILE::COPY - this was
just bad typing on my part. Using perl -V (capital V) was
suggested as a way to find out what is in my @INC but it seems
that my version is too old to use the -V switch (I get an
Unrecognized switch error back when I try to run this).

I would just like to thank John Porter for his multiple hints
and suggestions as well as many thanks to Ian Redfern for
suggesting
perl -e 'print "@INC\n"'

which worked - I got the following results
webCT # frankenstein # /home/webct>perl -e 'print
"@INC\n"' | more
/usr/local/lib/perl
/usr/local/perl5.001m/lib/sun4-solaris /usr/local/perl5.001m/lib
.

trying to look at the libraries above I get the following
webCT # frankenstein # /home/webct>cd
/usr/local/lib/perl
/usr/local/lib/perl: No such file or directory.
--this makes me thinks something is really broken but I did
look up the other two locations:

webCT # frankenstein # /home/webct>cd
/usr/local/perl5.001m/lib/sun4-solaris
webCT # frankenstein # lib/sun4-solaris>dir
total 14
drwxr-xr-x 2 root 1024 Feb 9 1996 CORE/
-r--r--r-- 1 root 12067 Feb 9 1996 Config.pm
drwxr-xr-x 10 root 512 Feb 9 1996 auto/
--I poked around in here but nothing seemed relevant to what I
was trying to do


webCT # frankenstein # lib/File>cd /usr/local/perl5.001m/lib
webCT # frankenstein # perl5.001m/lib>

--a directory listing showed a directory named "File" - finally
something !
webCT # frankenstein # perl5.001m/lib>cd File
webCT # frankenstein # lib/File>dir
total 26
-r--r--r-- 1 root 8553 Feb 4 1996 Basename.pm
-r--r--r-- 1 root 5176 Feb 4 1996 CheckTree.pm
-r--r--r-- 1 root 6864 Feb 4 1996 Find.pm
-r--r--r-- 1 root 4079 Feb 4 1996 Path.pm
-- but my hopes were dashed - apparently I don't have the
libraries to do file manipulation as I want to do.

It seems the general consensus is that I need to upgrade or at
least reinstall perl.

Thanks for all the fabulous help!

"Joyce E.Evans" wrote:

> Hello,
>
> I have been using perl for about 2.5 years most of my work
> has been in fixing other peoples scripts - reworking them to
> do something else or customizing/formatting output to their
> a webpage or an email, etc. (why reinvent the wheel you
> know) so I wouldn't call myself an expert or anything but I
> can usually figure this stuff out now I am trying to
> re-write a script and use the FILE::COPY module (instead of
> using system calls to copy files which is what had been done
> in this script) but it seems the machine I am working on
> doesn't support this method and I am at a lost at how to
> remedy the situation.
>

> We are using perl, version 5.001, Unofficial patchlevel 1m.

> on the machine that I am on (SunOS frankenstein.colorado.edu
> 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-250 )
>

> Can anyone tell me how to figure out where/ how to determine
> the exact value (which libraries) in @INC which are/aren't
> available (the FILE::COPY module should be standard
> according to my Programming Perl book) or why else I might
> be having this problem.
>

> Also, I tried to run the man page for perldebug but it

> apparently isn't installed on this machine. Perl isn't used

> much at CU Boulder so I am working in a sort of vacuum when


> it comes to expertise on this and don't know what to ask for
> or how to ask the system administrator to install so please
> be very specific about what I need to have installed - I can
> write perl ok but I am no unix system admin. (at least not
> yet).
>

> Thanks in advance.


> ****************************************
> Joyce E Evans
> University of Colorado at Boulder
> Applications and Information Systems
> WebCT System Administrator
> (303) 735-0216
> ******************************************

--

John Porter

unread,
Sep 16, 1999, 3:00:00 AM9/16/99
to
In article <37E1119F...@rtt.colorado.edu>, Joyce E.Evans wrote:
>
>/usr/local/perl5.001m/lib/sun4-solaris

> total 14
> drwxr-xr-x 2 root 1024 Feb 9 1996 CORE/
> -r--r--r-- 1 root 12067 Feb 9 1996 Config.pm
> drwxr-xr-x 10 root 512 Feb 9 1996 auto/
> --I poked around in here but nothing seemed relevant to what I
>was trying to do
>
>
>--a directory listing showed a directory named "File" - finally
>something !
>webCT # frankenstein # perl5.001m/lib>cd File
>total 26
>-r--r--r-- 1 root 8553 Feb 4 1996 Basename.pm
>-r--r--r-- 1 root 5176 Feb 4 1996 CheckTree.pm
>-r--r--r-- 1 root 6864 Feb 4 1996 Find.pm
>-r--r--r-- 1 root 4079 Feb 4 1996 Path.pm
>-- but my hopes were dashed - apparently I don't have the
>libraries to do file manipulation as I want to do.

Just for future reference, allow me to suggest another way to "debug"
this kind of problem: the -v switch to the perldoc command.
It tells you where it found the module (or if it was unable to), and
even tells you everywhere it looked. For example, on my system:

% perldoc -v File::Copy

Searching for File::Copy
Looking for File/Copy in /usr/local/lib/perl5/sun4-solaris/5.00404
[... etc.]
Found as /usr/local/lib/perl5/File/Copy.pm

[followed by the normal perldoc output]

In the case of a module which can't be found:

% perldoc -v File::NoSuchCopy

Searching for File::NoSuchCopy
Looking for File/NoSuchCopy in /usr/local/lib/perl5/sun4-solaris/5.00404
[... etc.]
No documentation found for "File::NoSuchCopy".

Just an idea; may come in handy...

--
John Porter


Peter J. Acklam

unread,
Sep 16, 1999, 3:00:00 AM9/16/99
to
"Joyce E.Evans" <eva...@rtt.colorado.edu> writes:
>
> I would just like to thank John Porter for his multiple hints and
> suggestions as well as many thanks to Ian Redfern for suggesting
>
> perl -e 'print "@INC\n"'

You can also use

perl -wle 'print for @INC'

which will give you one directory on each line.

Peter

--
Peter J. Acklam - jac...@math.uio.no - http://www.math.uio.no/~jacklam

0 new messages