Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I keep getting error message: Bareword "LOCK_EX" not allowed while "strict subs"use strict; my $listFile = "C:\\theData.xls"; my $listFile2 = "\\\\AnotherServer\\dir\\"; open (IN, "$listFile") || die "Cant open $listFile for reading: $!"; flock(IN, LOCK_EX) || die "Cant get LOCK_SH on $listFile: $!"; print(IN); system("copy $listFile $listFile2 > nul") == 0 || die "Copy failed."; print "Copy completed"; close IN || die "Cant close $listFile: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Lock on file
by duff (Parson) on Feb 10, 2006 at 15:34 UTC | |
|
Re: Lock on file
by Fletch (Bishop) on Feb 10, 2006 at 15:36 UTC | |
by Anonymous Monk on Feb 10, 2006 at 15:44 UTC | |
by Fletch (Bishop) on Feb 10, 2006 at 16:38 UTC | |
|
Re: Lock on file
by swampyankee (Parson) on Feb 10, 2006 at 18:25 UTC |