Just to be clear, this request is not specific to the perl version. Also in the python branch you can have attachments that are not linked at all, but also not cleaned up.
My opinion is that the best way to solve this is to have a menu item "Tools"->"Cleanup Notebook" that presents the user with a list of attachments that could be deleted with checkboxes for each item and a "delete" button.
Automatically deleting attachments when they are not linked may be a bit to aggressive.
Just to be clear, this request is not specific to the perl version. Also in the python branch you can have attachments that are not linked at all, but also not cleaned up.
My opinion is that the best way to solve this is to have a menu item "Tools"->"Cleanup Notebook" that presents the user with a list of attachments that could be deleted with checkboxes for each item and a "delete" button.
Automatically deleting attachments when they are not linked may be a bit to aggressive.