Recent posts
May 2011
March 2011
- My indent style for perl
You can see my indentation style in articles around, but here is a way I am using to automate this layout. It is handy when I get some messy code and also practical to reformat some parts of my code.
December 2010
November 2010
- Display time from other timezone
I am still working on packet analyzer I mentioned last time. Another problem to solve - capture happen in different timezone and I need to output correct time regardless of where my script is running.
- Convert hexdump to binary data
Working on analysis of network packets I needed to convert data dumped in a file to real binary form before processing them further.
- Term::ReadLine::Perl on Windows
I plan to write simple console application to interface with databases I maintain. Something like mysql command do, but with few advanced features like autocompletion (which does not work in mysql on Windows) or sending output to pager.
October 2010
- Date parsing
Date parsing is always problematic. For most of my work I prefer canonical YYYY-MM-DD or YYMMDD format that is great for sorting and easy to parse. But data comes from various sources. Recently I got data with all dates in US format: Wed, Sep 17 2003.
- Address alignment
During recent work on analysis of ELF (Executable and Linkable Format) file format I needed implement proper alignment of data in sections.
- Local jekyll
Since I started using jekyll for this site, I wanted to have local instance of it installed on my Windows machine for testing. Finally I made it working, here are steps I did.
- Error like printf
Sometimes it is handy to have single function to quit application with an error message. Even better when it accepts printf formatting.
September 2010
- Repeated match with regex
I wrote parsing for graphviz dot files today and found interesting feature of perl regex engine. It can match a pattern repeatedly to sections of the string.
- Section numbering with Template Toolkit
Recently I was working on documentation for web-based intranet application. Every page is created from templates processed by Template Toolkit. So why not move heading definition into separate block and generate TOC automatically.
- Log::Log4perl in multiple processes
I am using Log::Log4perl to produce logs from my perl fastcgi applications. There is typically several same processes writing into same log. I was wondering if it is possible to lose some messages this way.