The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 03-09-2007
matrixmadhan matrixmadhan is offline
Technorati Master
 

Join Date: Mar 2005
Location: k-tier distributed caching
Posts: 2,736
Code:
#! /opt/third-party/bin/perl

open(FILE, "<", "a" ) || die "Unable to open file a <$!>\n";

while ( <FILE> ) {
  chomp;
  $fileHash{$_} = $i++;
}

close(FILE);

open(FILE, "<", "b" ) || die "Unable to open file a <$!>\n";

while( <FILE> ) {
  chomp;
  if( exists $fileHash{$_} ) {
  }
  else {
    print "$_\n";
  }
}

close(FILE);

exit 0
Reply With Quote