Re: Comparing two directories

2004-10-28 Thread John W. Krahn
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

RE: Comparing two directories

2004-10-27 Thread Mallik
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

Re: Comparing two directories

2004-10-27 Thread Mark Goland
- 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

Re: Comparing two directories

2004-10-27 Thread Vladimir Lemberg
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