#!/usr/perl/bin/perl use Modern::Perl; $|=1; my($data) = '/root/Desktop/inputfile.txt'; open STDIN, '<', $data or die "File error: input file: $!"; open STDOUT, '>', '/root/Desktop/output.log' or die "File error: output file: $!"; my(%result) = (); while (defined($_ = )) { chomp $_; my ($index, $value) = split( /\s/, $_, 0 ); $result{$index} = $value; } while (my ($index, $value) = each(%result)) { do { say "$index => $value" if $value > 500; }; } close STDIN; close STDOUT;