in reply to Re^4: Problem in using 'ëxists" function to see if a key exists for a hash
in thread Problem in using 'ëxists" function to see if a key exists for a hash

array @port_list which I get by reading a input file

Maybe your error is in the reading code which you haven't shown.
Have you Dumped @port_list to check ?

Update ; It looks like you may have leading spaces on the duplicates. Try adding another regex line

foreach my $val (@port_list) { $val=~s/\s+$//; $val=~s/^\s+//; # add print "[$val]\n"; . . .
poj

Replies are listed 'Best First'.
Re^6: Problem in using 'ëxists" function to see if a key exists for a hash
by achs (Initiate) on Feb 17, 2016 at 12:25 UTC
    Thanks very much. It worked!! :)