in reply to comparing elements in 2 hashes...
no, this isn't homework, just something i'm supposed to put together for work. Thanks#!/local/bin/perl -w $build = ''; print "Which build (enter full path name)? \n" ; chomp($build = <STDIN>); open(FILE, "/home/me/stuff/input.txt") || die "Could not open input file\n"; open(BUILD_FILE, $build) || die "Could not open input file\n"; %file_list = (); %build_file = (); while(<FILE>){ $file_list{$_} = 1; } while(<BUILD_FILE>){ $build_file{$_} = 1; } foreach $bkey (sort keys %build_file) { foreach $line(keys %file_list){ if ($line =~ $bkey){ print "YES\n"; } else{ print "NO\n"; } } } close(FILE); close(BUILD_FILE);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: comparing elements in 2 hashes...
by RMGir (Prior) on Jul 02, 2002 at 19:49 UTC | |
Re: Re: comparing elements in 2 hashes...
by ton (Friar) on Jul 02, 2002 at 19:56 UTC | |
Re: Re: comparing elements in 2 hashes...
by PerpLexicon (Novice) on Jul 02, 2002 at 19:57 UTC |