So I am brand new to Perl and this is my first program (excluding a few basic tutorials to get to grips with very basic syntax)

What I want to do is rename all files within a specified directory to "File 1", "File 2", "File 3" etc

This is the code I have got so far:

```
use 5.16.3;
use strict;

print "Enter Directory: ";
my $directoryPath = <>;
chdir('$directoryPath') or die "Cant chdir to $directoryPath$!";

@files = readdir(DIR); #Array of file names
closedir(DIR);

my $i = 1; #counting integer for file names
my $j = 0; #counting integer for array values
my $fileName = File;

for (@files)
{
    rename (@files[j], $fileName + i) or die "Cant rename file @files[j]$!";
    i++;
    j++;
}

chdir; #return to home directory

```

I have a number of issues:

1: Whenever I try to change directory I get the 'or die' message. I am wondering if this is to do with the working directory I start from, do I need to go up to the C: directory by doing something like '..\' before traversing down through a different directory path?

2: Error message 'Bareword "File" not allowed while "strict subs" in use'

3: Same as point 2. but for "i" and for "j"

4: Error message 'Global symbol "@files" requires explicit package name'

Note: I can obviously only get error one if I comment out everything after line else the program won't compile.