Vladimir Lemberg wrote:
Hi,
Hello,
Could you help me to find what's wrong in my script?
I need to compare two directories and if file exists in both - print it.
die "Usage: 2 arguments must be passed i.e. file1 file2\n" if @ARGV != 2;
opendir DIR1, $ARGV[0] or die "couldn't open $ARGV[0] for readin
me;
if (-e $fname) {
print "$filename\n" if $filename eq $_ ;
}
}
-Original Message-
From: Mark Goland [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 9:29 AM
To: Vladimir Lemberg; [EMAIL PROTECTED]
Subject: Re: Comparing two directories
- Original Messag
- Original Message -
From: "Vladimir Lemberg" <[EMAIL PROTECTED]>
To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, October 27, 2004 8:16 PM
Subject: Re: Comparing two directories
Hello,
I beleave the two code
Actually, this is my script:
foreach $filename(readdir DIR1) {
next if $filename =~/^\./;
while (readdir DIR2){
print "$filename\n" if (-e $filename);
last;
}
}
- Original Message -
From: "Vladimir Lemberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 27