You have stuck strictures (use strict; use warnings;) at the start of the script you have shown us, but most of the errors NetWallah describes in Re: Syntax Error deleting files and folders in a directory would be picked up by strictures but are masked by an error you don't describe:
Possible attempt to separate words with commas at noname.pl line 4. "make_path," is not exported by the File::Path module Can't continue after import errors at noname.pl line 4. BEGIN failed--compilation aborted at noname.pl line 4.
After fixing the first error flagged by strictures we get:
Parentheses missing around "my" list at noname.pl line 16. "my" variable @files masks earlier declaration in same scope at noname +.pl line 20. Global symbol "$deleletes" requires explicit package name at noname.pl + line 20. Execution of noname.pl aborted due to compilation errors.
I guess the first of those errors is the one you are having trouble with, but it's a little hard to tell because it's not on the line you describe and you don't tell us what the actual error is. However strictures picked up four out of five serious errors that NetWallah reported. tobyink reported another error and it is very likely that:
my $destinationDir = 'C:\Users\Shaun\Documents\$website';
which assigns a path string ending in '$website' (not the contents of the Perl variable $website) to the variable $destinationDir is probably not what you intended, but given the absence of $website elsewhere in the script it's hard to be sure.
So a bunch of lessons here:
Oh, and as an aside: don't use tabs for indentation. Convince Eclipse (with a blunt instrument if need be) to insert spaces instead of tabs. Your indentation is fine, but the tab characters screwed up what NetWallah saw.
In reply to Re: Syntax Error deleting files and folders in a directory
by GrandFather
in thread Syntax Error deleting files and folders in a directory
by smturner1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |