Marco wrote:
> On Wed, Jan 22, 2003 at 01:07:19PM -0000, Rob Dixon
> <[EMAIL PROTECTED]> wrote:
>
>> push @files, join ' and ', delete @files[-2,-1];
>
> Your program successfully matches the entries, prints in which files
> the string is found:
>
> Zone foo.com was found in files and boot.fixed
>
> But it also prints the following warnings:
> Use of uninitialized value in join or string at checkdomain.pl line
> 19, <> line 1.
Sorry, I didn't account for the cases where the zone was found in
less than two files!
while (<>) {
chomp;
if ($files = $zone{$_}) {
if ((my @files = @$files) >= 2) {
push @files, join ' and ', delete @files[-2,-1];
}
print "Zone $_ was found in files ", join (', ', @files),
"\n";
} else {
print "Zone $_ was not found\n";
}
}
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]