You have to tell Perl which packages you intend to use, with the use command:
# use packagename;
# For example:
# use File::Copy;
#!/usr/bin/perl -w
use File::Copy;
$input = "text.txt";
$output = "text1.txt";
copy($input, $output) or die
"Can't copy $input to $output due to $!.";