Yokupoku Maioku
Yokupoku Maioku

Reputation: 503

Undefined subroutine when moving a file

My current directory is composed in this way:

currentDirectory
 - folder1
   -file1
 - folder2

In code I wrote to move file1 to folder2 this according to the File::Copy doc:

move("folder1/file1","folder2/file1");

I'm getting an error:

Undefined subroutine &main::move at script.pl line 49

Upvotes: 2

Views: 957

Answers (1)

toolic
toolic

Reputation: 62236

My guess is that you either forgot to include the module with use:

use warnings;
use strict;
use File::Copy;

move("folder1/file1","folder2/file1");

Or you have something like:

use File::Copy qw();

Upvotes: 3

Related Questions