2012.03.13 in #34
Created and announced by Sinan Unur.
2012.04.17 in #39
HTML::TableExtract is beautiful
In this post, Sinan Unur gives a beautiful example how Perl can help with unemployment. Or at least how you can use the HTML::TableExtract module to, well, extract tables from an HTML page. Also, I think posting beautiful examples of Perl solutions to actual problem is much better than complaining about bad examples.
2012.04.22 in #39
My favorite editor is Vim
Sinan Unur explains why Vim is his favourite editor, even though he hardly knows it and how a $20 investment helped him reduce his time wasting by 30%. I like how he puts real numbers to his 'cost' and 'profit'.
2012.04.28 in #40
How do you pass the PostData argument to the Navigate method of IWebBrowser2 using Win32::OLE?
by Sinan Unur
2012.05.02 in #41
Generate pretty weekly schedule charts using HTML::Template
A nice example by Sinan Unur showing usage of perl + HTML + CSS (setting the width style attributes by the template). In the script he is using /x \A and \Z in regexes and it really is nice.
2012.05.12 in #42
A file download CGI script in Perl
Sinan Unur wrote a detailed description on how to create a file download script.
2012.05.20 in #43
Updating all outdated Perl modules
This is not good for strict versioning of the dependencies you are using, but during development, or just for fun, it is very useful to upgrade all the modules you have installed to their latest version. See the solutions of Sinan Unur using cpan-outdated and cpanm.
2012.06.20 in #48
Don't Box Me In: YAPC::NA 2012 Impressions
Apparently, Sinan Unur was not all that happy with the opening talk of Schwern. I liked what and how Schwern said and have not thought of this aspect. That's why I am happy to be around people who can see way more than I do.
2012.06.27 in #49
On Windows, how can I maximize a window created using Win32::OLE?
This is a code example by Sinan Unur. Also without detailed explanation, but with useful code.
2012.07.04 in #50
What is '-f>@+?*<.-&'_:$#/%!' in Perl?
That's horrible, but real. Sinan Unur explains what does this code do and when would you want to write like this.
2012.09.24 in #62
An HTML parser will make your life easier even if you extract information using regexes from a web page
Sinan Unur is trying to figure out how the US Department of Labor is revising the new unemployment claims every week. The task is especially interesting as the format of the web page displaying the data is slightly different on some weeks. As if humans were involved.
2013.02.01 in #80
Large gzipped files, long lines, extracting columns etc
So, you have those massive gzipped log files: how to plow through them in less than geological times? Sinan Unur tries to find out.
2013.03.26 in #88
Creating a matrix of random entries where lengths of the columns are also random
Sinan Unur amuses himself and comes up with an elegant way of solving that problem.
2013.04.22 in #92
Randomly and non-destructively pick two items without replacement from an array
Sinan Unur beautifully explained several options about how to solve the problem. First a 'naive', but natural solution, and then a much more clever version of it.
2013.08.20 in #109
Read select lines from a file using Perl
Sinan Unur took a question from Stack Overflow and wrote a longer post involving some functional programming.
2013.08.28 in #110
Lazy lists are good
Sinan Unur shows how to generate an iterator to return numbers in a certain range, or even one that does not have a specific end. One that can provide an endless supply of numbers, or and endless loop if are not careful.
2013.10.06 in #115
Comma quibbling in Perl
Sinan Unur shows his example to this special cases of joining some strings together. Taken from Rosetta Code.
2013.11.05 in #120
Are Perl users unable to write programs more accurately than those using a language designed by chance?
Yes, says Reddit. Balderdash, replies Sinan Unur.
2013.12.05 in #124
Can One Write Readable and Maintainable Perl?
Sinan Unur asks, and answers, the tough question. (spoiler alert: the article begins with a thundering 'YES')
2014.01.30 in #132
Randomness and statistical concepts
This is strictly for people who understand statistics, or who want to understand it! Sinan Unur explains why the statements of Ovid when using random dice rolls, were incorrect.
2014.02 in #133
Parsing HTML with Perl
An article by A. Sinan Unur using regexes and HTML::TokeParser::Simple.
2014.03.12 in #138
Sometimes, all it takes is a simple change to make your Perl code run on Windows
The difference between directory separator characters between Windows and Linux has tripped me many times. Especially in testing. Now Sinan Unur shows how we could improve our tests script be be less platform dependent.
2014.04.07 in #142
Why did Extutils::ParseXS fail tests after building perl on Windows 8.1?
Sinan Unur is fighting with the compilation of Perl on his brand new Windows machine. The solution is in linking with the 64-bit libraries.
2014.04.16 in #143
Is a strong caution about Heartbleed worth the disruption to distributions with a declared dependency on Crypt::SSLeay?
Sinan Unur has been quite busy discussing the fallout from the Heartbleed OpenSSL bug and how it relates to Perl.
2014.04.24 in #144
A non-exceptional failure in the catch block
Exceptions are tricky. Sinan Unur hits a classical wrong assumption in his code and share it, for our enlightenment and as a warning to us all.
2014.05.18 in #147
What good is in an iterator?
If this is one of the questions that keep you awake at night, Sinan Unur might have some answers for you.
2014.07.10 in #155
Fun with image transformations in Perl
Sinan Unur is having fun swapping pixels between classic paintings using GD::Image.
2014.08.16 in #160
Just uploaded App::multiwhich in observance of CPAN day
Sinan Unur releases App::multiwhich, a variation of the venerable 'which' command.
2014.08.18 in #161
File::Which comes with its own 'multiwhich'
Sinan Unur released App::multiswitch last week-end, as part of CPAN Day. Later on, he realized he might have reinvented a wheel already included in File::Which's trunk. Oops.
2014.08.29 in #162
Replacing hash keys with values does not a translation make
Sinan Unur (Sinan) thinks the Turkish translation of the Perl Maven pages actually harm would-be programmers. Naturally I disagree, but he has a point: Bad translations can indeed harm people. The only thing I can do is to suggest to collaborate with other translators to improve the text. It is available in GitHub
2014.10.09 in #168
Why was documentation for open FILEHANDLE removed from perlfunc?
Mistake, or sinister conspiracy to mask Perl's terrible secrets? Sinan Unur unearthed hidden lore about the 'open' function from Perl's git history.
2014.10.09 in #168
A bug in Perl's autodie
While crafting a Perl quine, Sinan Unur came across a very peculiar corner case bug of autodie.
2014.10.09 in #168
How does open 0; print <0>; turn every Perl program into a quine?
In the scientific world "now that's funny..." usually announces a major breakthrough. In the Perl world, as Sinan Unur illustrates, it's typically a harbinger of golfing fun.
2014.10.10 in #177
int main in C and hard coded directory separators in Perl
In Perl-land, it's easy to lull oneself in the fallacy that all the world is UNIXish and do things like assuming that file path separators are always '/'s. Don't, Sinan begs of you, mostly considering that doing The Right Thing is not as hard as you might think.
2014.10.10 in #177
Automated Internet Explorer screenshots using Win32::OLE
If you are doing web testing on Windows platforms, you'll loooove want Sinan has for you.
2014.11.01 in #171
What does int a, b, c do in Perl?
Strange question that appeared on Stack Overflow explained by Sinan Unur.
2014.11.09 in #173
Tests should not fail due to EOL differences across platforms
I totally agree with Sinan, especially when we are talking about such central module as Module::Install. The question, how can one easily notice and correct if one of the tests fails due the line ending differences between Windows and Unix and is there an article with 'best practices' for such situation?
2014.11.10 in #173
Interpolatable HTTP status codes: Another way
Sinan is using Const::Fast to export the values of HTTP::Status in a read-only hash called %HTTP. An exercise in diversity of solutions for the same problem.
2014.11.13 in #173
64-bit Perl 5.20.1 with Visual Studio 2013 Community Edition on Windows 8.1
Microsoft have made Visual Studio 2013 Community Edition available. You can use it for free. Sinan took it for a ride to compile Perl.
2014.11.14 in #173
Who put an extra CR in my CRLF? Fun with PerlIO layers
2014.11.17 in #174
TDD is all well and good, but who's testing the tests?
Sinan Unur (NANIS) demonstrates why we all need to know how to use quotemeta.
2014.11.18 in #174
Building Perl 6 with Visual Studio 2013
Sinan Unur (NANIS) decided to try and compile Rakudo Perl with Visual Studio 2013, which Microsoft made freely available.
2014.11.21 in #174
Using the Windows text-to-speech API
Sinan Unur (NANIS) shows how to use the Windows Speech API to convert text to speech.
2014.11.28 in #175
More adventures in test failures
Sinan Unur keeps bumping into test failures while using perl 5.20.1 compiled with Visual Studio 2013 CE. I wonder if he is also sending bug-reports or even patches to fix these issues, or is he trying to get people understand the problems and fix them by themselves? Have you sent any patches (or pull requests) recently?
2014.11.29 in #175
A curious case of a directory separator related test failure in Dancer2
This time the directory separators were returned incorrectly on Windows.
2014.12.01 in #176
Time is a scarce resource
Sinan Unur muses (more than once) on the right thing to do when you hit problems trying to install someone else's software. These resonated with me, since I spent way too long trying to get GD and GD::Graph working on a machine last week. Sometimes, when you've got the damn thing working, you're out of time and energy, and just need to move on. And sometimes not.
2014.12.17 in #178
When bits don't stick
Sinan presents more portability bugs he's found in Perl modules, and promises he'll submit patches.
2014.12.27 in #179
UTF-8 output in cmd.exe: perl 5 vs perl 6
Does Perl 6 think that everything is Unix? Or is it just the current version of the implementation?
2015.01.24 in #183
Construct the path to a file in the same directory as the current script
2015.02.05 in #185
Building libexpat and XML::Parser on Windows 8.1 64 bit using Visual Studio 2013
One of the hard things when building a Perl distribution is including various external libraries. For example libexpat and libgd. This is what Sinan faced the week.
2015.03.20 in #191
How you average numbers matters
We all know (or should know) that computations in a computer are not exact, but when Sinan puts it in front of us it is still very disturbing.
2015.05.26 in #201
Who is testing the tests?
Or how to convince Perl it has not loaded a module yet even though it already has.
2015.06.24 in #205
Include image data in your Perl script or module
Embedding text in a Perl script is no biggie. But how about binary stuff, like images? There's many ways to do it, and Sinan shows a few.
2015.08 in #213
Playing with the TrueRNG 2 hardware random number generator
Even if you write your code in C, you can still include a Perl script
2015.08.07 in #211
Test failures and directory separators: Take N
Sinan tested Inline::CPP on Windows 8.1 and had some test failures. He steps us through the path to fixing them, which as you can guess from the title, came down to directory separators.
2015.08.25 in #214
Slashing one's feet with tests, or, how to fix 2,950 test failures in one fell swoop
He flies faster than a speeding train, leaps tall buildings in a single bound, and fixes 2,950 failing tests with a single character, it's Sinan Unur!
2015.11.08 in #224
A quick'n'dirty Perl script to download the entire TPP and combine it into a single PDF document
Office of the Unites States Trade Representative released the full text of the Trans-Pacific Partnership trade agreement in 239 individual PDF documents.
2015.11.22 in #226
Dive into the Global Historical Climatology Network data using Perl and SQL
I always love to see real-world applications of Perl. I also find the results very interesting. Both the increase in temperature and the strange hump in the number of observations.
2015.11.23 in #227
What happens to tests that are never run?
Sinan spotted a test in a widely used module that was meant to be checking one thing, but was checking something slightly different. A great example of why code reviews are a good idea.
2015.12.04 in #228
Free go faster stripes for your Perl programs
There is an an optimization coming for Perl 5.24 that might boost some benchmarks by 25% to 40%. Sinan gives the nitty gritty details of this upcoming nitro injection to the Perl engine.
2015.12.13 in #229
Perl6's newline conversion behavior seems to be by design
Sinan noticed that Perl 6's handling of newline characters, which has been mentioned in various blogs recently, can cause problems on Windows. This follows on from an earlier post where he hit the issue.
2015.12.23 in #231
Perl6's newline translation behavior has been fixed
Two weeks ago we include a post from Sinan, where he pointed out some unexpected behaviour with handling of newlines in Perl 6. Sinan happily reports that it was fixed in time for Christmas.
2015.12.28 in #232
Rakudo Perl 6 was released on Christmas
Sinan, the representative of the dark side with his Microsoft Visual Studio 2015 at hand took the new toy to a spin. It crashed and burned (what else would you expect from a butterfly hitting windows), but Sinan seems to be happy with the results.
2016.01.15 in #234
An Excellent Optimization Story
Not a Perl article, but it involves Sinan and brian, so I feel honour-bound to include it. Sinan made some code run a lot quicker.
2016.02.24 in #240
Perl is spreading to Windows
If you install Visual Studio 2015, you also get a version of Perl. Is this good? Is this bad? Check what the Redditers have to say.
2016.03.04 in #241
A tar anomaly
Sinan noticed that a certain distribution fails to install on Cygwin, and tracked it down to this: if a tar file has
foo.exe, then when you extract from the tar file you'll get
foo but not
foo.exe. See here for example discussion.
2016.04.01 in #245
Looking back at the scary DJIA crystal ball
DIJA - Dow Jones Industrial Average is what many consider as the main indicator of the how the world economy is doing. So if you show that it behaves similarly to what happened before the 1933 crash everyone will go nuts. So what can an Economist Perl programmer do?
2016.05.15 in #251
Perl is not the fastest language
...but with 5.24 it skids past Python 3 on the benchmark and is hot on Ruby's tail. Woohoo!
2016.05.22 in #252
Define and use constants for use by other modules in Perl
A discussion on how define a group of constants that you might want to share across a system. Sinan favours Const::Fast used together with Importer.
2016.06.07 in #255
Manipulate %PATH% in the current Windows cmd.exe window with help from Perl
Then apparently there is pa as well by Nicolas Georges
2016.06.09 in #255
An old Visual C printf bug affects Perl
While currently neither Strawberry Perl nor ActivePerl are using Visual C, IMHO it is important that Sinan took upon himself to torture Perl with Visual C.
2016.06.30 in #258
How to sum data from multiple files in Perl?
Sinan takes us through a problem posed on Stack Overflow, and how he approached it.
2016.12.12 in #282
Know what you are testing: The case of the test for median in Boost.Accumulators C++ Library
2017.02.08 in #290
Notes on Unicode on the command line in Windows with applications to Perl and Perl 6
Way more than I will ever understand about Unicode. I am glad people like Sinan make the effort.
2017.02.18 in #291
Fixing Perl's Unicode problems on the command line on Windows: A trilogy in N parts
Sinan looks at some of the problems you might encounter trying to use Unicode with Perl on Windows.
2017.02.27 in #293
For your 'İ's and 'ı's only
Sinan has been grubbing around in Perl's internals, as part of his ongoing quest for something-or-other related to Unicode, Perl, and Windows.
If you are not yet subscribed, you can do it now. Free of charge:
Just ONE e-mail each Monday. Easy to unsubscribe. No spam. Your e-mail address is safe.
This newsletter is about the Perl Programming languages.