#!/usr/bin/perl -w use strict; my %firstfile; open IN_A, "<a.log" or die "$!\n"; while (<IN_A>) { chomp; $firstfile{$_}++; } close IN_A; open IN_B, "<b.log" or die "$!\n"; while (<IN_B>) { chomp; print if exists($firstfile{$_}); } close IN_B;
Cheers,
Darren :)
In reply to Re: Efficient code.
by McDarren
in thread Efficient code.
by murugu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |