I have a file (say bugs.txt
) which is generated by running some code. This file has list of JIRAS. I want to write a code which can remove duplicate entries from this file.
The logic should be generic as the bugs.txt file will be different everytime.
sample input file bugs.txt
:
BUG-111, BUG-122, BUG-123, BUG-111, BUG-123, JIRA-221, JIRA-234, JIRA-221
sample output:
BUG-111, BUG-122, BUG-123, JIRA-221, JIRA-234
My trial code:
my $file1="/path/to/file/bugs.txt";
my $Jira_nums;
open(FH, '<', $file1) or die $!;
{
local $/;
$Jira_nums = <FH>;
}
close FH;
I need help in designing the logic for removing duplicate entries from the file bugs.txt