PDA

View Full Version : "Undefined subroutine &main::move" when using FILE::COPY


fauxpasny
08-21-2006, 08:04 PM
I was working in a much larger program and able to whittle my problem down to just a few lines of code:

use strict;
use warnings;

use FILE::COPY;

move("c:/Scripting/VOD/test.mpg","c:/Scripting/VOD/movetest/test.mpg");

The error I get is "Undefined subroutine &main::move called at C:/Scripting/VOD/movetest.pl line 6"

Thing is, I've checked my perl directory and C:\PXPerl\lib\File\copy.pm exists. I've also tried a fresh install of PXPerl to no avail.

Any help greatly appreciated.

KevinADC
08-21-2006, 09:23 PM
module names are case sensitive on case sensitive operqating systems like Linux (but not windows) so use File::Copy instead of the incorrect FILE::COPY and see if that helps. Always use the proper case for module names, sub routines, functions, etc etc etc, even on windows, because if you transfer the script to a nix box it will no longer work.