in reply to Breaking out of a loop
poj#!/usr/bin/perl use warnings; use strict; my %git=(); my $git_file = "/tmp/git_sorted.log"; open(GIT,'<',$git_file) or die "Really bad $git_file : $!"; while (<GIT>){ chomp; $git{$_}=1; } close GIT; my $yum_file = "/tmp/yum_sorted.log"; open(YUM,'<',$yum_file) or die "Really, really bad $yum_file : $!"; while (<YUM>){ chomp; if (exists $git{$_}){ # exists } else { # new print "$_ package not in $git_file\n"; } } close YUM;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Breaking out of a loop
by NetWallah (Canon) on May 12, 2013 at 19:16 UTC |