G'day peli,
Welcome to the Monastery.
As ++karlgoethebier pointed out, and which you apparently didn't understand, you have a disembodied "use version" at the start of your code. You probably intended something else (see version) but didn't complete that line. Perl keeps reading until it finds a statement terminator (the semicolon, two lines later); it sees something like this:
$ perl -MO=Deparse -e 'use version $X="x";' use version ($X = 'x'); -e syntax OK
Your choice of using dynamic, instead of lexical, variables is questionable. As you've only provided part of your code, it's not possible to tell what effect that might have. I'd recommend using lexical variables; and using them in the smallest scope possible.
You should always use the strict and warnings pragmata. See "perlintro - Perl introduction for beginners" for further discussion.
You are using two different methods for handling whitespace in pathnames (i.e. "X X" and "X\ X"). Investigate whether that's causing any problems.
It's hard to tell with only part of the code presented; however, it looks like you're performing various file operations without checking whether they worked as expected. Perl's builtin autodie pragma can probably do most, if not all, of this work for you; alternatively, write the code for these checks yourself.
— Ken
In reply to Re: Backup User's files
by kcott
in thread Backup User's files
by peli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |