The substr solution assumed a newline to be present. The new solution will not remove the newline if it goes missing in the future. Apparently this is idiomatic perl. Thanks pennae for the suggestion!
22 KiB
22 KiB