in reply to Perl - Remove duplicate based on substring and check on delimiters
You can use chmod to change file's permissions if you have sufficient permissions to chmod the file.
You should check open's success, so you know directly if open was successful or not and you can behave accordingly.
edit: fixed typoopen(my $handle, '>>', $filename) or die "open($filename,w+) failed: $ +!";
In Section
Seekers of Perl Wisdom