Perl_doubts has asked for the wisdom of the Perl Monks concerning the following question:

i have a simple perl script that copies a file from an XP machine to an NT machine (my script runs on the NT machine). when i execute the script, i'm getting the following error:

Undefined subroutine &main::move called at (the line given below).

move($oldfilename, $newfilename) or die "move failed: $!";

The two variables in the move statement have been set properly. I've given the following statement in my script.

use File::copy;

Replies are listed 'Best First'.
Re: undefined subroutine
by Sidhekin (Priest) on May 06, 2004 at 20:17 UTC

    You should use File::Copy; ... with an upper case 'C'.

    One of the most annoying things about the (case) insensitive MS OSes is that loading the file File/copy.pm succeeds, but the symbols are not correctly imported in perl ... since &File::copy::import is not defined. (Whereas &File::Copy::import is defined, but perl has not been told to go looking for it.)

    print "Just another Perl ${\(trickster and hacker)},"
    The Sidhekin proves Sidhe did it!