{"action":"created","issue":{"url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/1","labels_url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/1/comments","events_url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/1/events","html_url":"https://github.com/ltagliaferri/TextCleanup/pull/1","id":125772220,"number":1,"title":"Patch to bring HTMLToCleanTxt.pl more in line with modern Perl best practices","user":{"login":"carwash","id":896052,"avatar_url":"https://avatars.githubusercontent.com/u/896052?v=3","gravatar_id":"","url":"https://api.github.com/users/carwash","html_url":"https://github.com/carwash","followers_url":"https://api.github.com/users/carwash/followers","following_url":"https://api.github.com/users/carwash/following{/other_user}","gists_url":"https://api.github.com/users/carwash/gists{/gist_id}","starred_url":"https://api.github.com/users/carwash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carwash/subscriptions","organizations_url":"https://api.github.com/users/carwash/orgs","repos_url":"https://api.github.com/users/carwash/repos","events_url":"https://api.github.com/users/carwash/events{/privacy}","received_events_url":"https://api.github.com/users/carwash/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-09T18:01:06Z","updated_at":"2016-01-10T02:01:01Z","closed_at":"2016-01-10T01:57:46Z","pull_request":{"url":"https://api.github.com/repos/ltagliaferri/TextCleanup/pulls/1","html_url":"https://github.com/ltagliaferri/TextCleanup/pull/1","diff_url":"https://github.com/ltagliaferri/TextCleanup/pull/1.diff","patch_url":"https://github.com/ltagliaferri/TextCleanup/pull/1.patch"},"body":"Thanks for a really useful little script! Some of the Perl idioms it uses are a bit antiquated though, and even deprecated in some cases; I've updated it slightly to better reflect 'modern' Perl:\r\n\r\n- Added shebang line and changed file permissions to 755 to make script executable;\r\n- Always `use strict;` and `use warnings;`\r\n- All variables now declared with `my`;\r\n- `use autodie;` (from 2.12 onwards) means never having to say `or die` when opening files;\r\n- Updated link to HTML::Restrict to MetaCPAN;\r\n- `use open` with `:raw` mode lets us skip calling `binmode()` for open files after the fact;\r\n- Use the three-argument form of `open()` for safety;\r\n- Input record separator shenanigans now restricted to a single block;\r\n- Removed unnecessary `$newfile` variable;\r\n- Replaced bareword filehandles with lexical file handles;\r\n\r\nIf you're interested I've also created [another patch](https://github.com/carwash/TextCleanup/tree/args) that lets you process several files at once, specify which files you'd like to work on from the command line, rather than having to edit the source code every time. If you accept this pull request, I can send another for that one, if you like.\r\n\r\nHope this is useful. Best wishes, and thanks again!\r\nMarcus"},"comment":{"url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/comments/170300414","html_url":"https://github.com/ltagliaferri/TextCleanup/pull/1#issuecomment-170300414","issue_url":"https://api.github.com/repos/ltagliaferri/TextCleanup/issues/1","id":170300414,"user":{"login":"ltagliaferri","id":5977693,"avatar_url":"https://avatars.githubusercontent.com/u/5977693?v=3","gravatar_id":"","url":"https://api.github.com/users/ltagliaferri","html_url":"https://github.com/ltagliaferri","followers_url":"https://api.github.com/users/ltagliaferri/followers","following_url":"https://api.github.com/users/ltagliaferri/following{/other_user}","gists_url":"https://api.github.com/users/ltagliaferri/gists{/gist_id}","starred_url":"https://api.github.com/users/ltagliaferri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltagliaferri/subscriptions","organizations_url":"https://api.github.com/users/ltagliaferri/orgs","repos_url":"https://api.github.com/users/ltagliaferri/repos","events_url":"https://api.github.com/users/ltagliaferri/events{/privacy}","received_events_url":"https://api.github.com/users/ltagliaferri/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T02:01:01Z","updated_at":"2016-01-10T02:01:01Z","body":"Thank you, Marcus! Yes, please send the other patch so we can merge it."}}