Re: code help



jammer wrote:
Why does this give a syntax error?

There is no syntax error there.

# not 2 arguments, print usage
if ($#ARGV != 1) {

That's a great way to confuse a newby. Why does the comment say "2 arguments" but you are comparing the variable to 1? Try it like this:

# not 2 arguments, print usage
if ( @ARGV != 2 ) {

print "\nusage: " . $ARGV[0] . "\[backupDir\] \

Unlike C, Python, etc. the first argument of @ARGV is *not* the program name, you want the $0 variable instead.

[backupConfigFile\]\n";
}


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.