
Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts
Monday, April 30, 2007
slashtime - handy and powerful
Due to nature of my work, time to time I need to know the current time in different timezones. I was scared when I saw various applications on my colleagues desktops consuming megabytes of memory, slowing down startup of laptops and the money its costs. Luckily for Unix likers there is simple perl script called slashtime. Get it here, save it to /usr/local/bin and make it executable. Then edit ~/.tzlist (sample file is on the webpage as well) to suit your needs and then anytime you need to know:
Small but handy and powerful.

Tuesday, April 3, 2007
tests in Perl are easy and funny
and it used to be my nightmare. Many times I see my self scared of things that are actually easy. Probably problem in my head. I used to think that anything new is way above my limits. With this in mind actual learning takes a lot longer and in the end I many times scratch my head that it wasn't that hard. So let's change this attitude and move on to Perl tests.
I've touched Perl first time in my current job where something more powerful than bash scripting was needed to automate all we do. Firstly we had some easy perl scripts doing one task, spread around the boxes. Soon we've realized this is not going to be maintainable. Took some time and learned how to write Perl modules. There are many great articles on the web that tells you how, this one is sounds like nice summary to me.
Today I've decided and went one step further and write tests (I know they should be written in first place, but hey at least I'm writing documentation first).
So I went to perldoc Test::More and after some reading this line has stopped me:
"STOP! If you’re just getting started writing tests, have a look at Test::Simple first."
Ok, move on to perldoc Test::Simple :
"** If you are unfamiliar with testing read Test::Tutorial first! **"
And finally this seems like the one to start. First sentence there is:
" AHHHHHHH!!!! NOT TESTING! Anything but testing!
Beat me, whip me, send me to Detroit, but don’t make me write tests!
*sob*
Besides, I don’t know how to write the damned things.".
I feel like home now, anyway don't let that scare you, writing tests in Perl is actually easy in the end.
I've touched Perl first time in my current job where something more powerful than bash scripting was needed to automate all we do. Firstly we had some easy perl scripts doing one task, spread around the boxes. Soon we've realized this is not going to be maintainable. Took some time and learned how to write Perl modules. There are many great articles on the web that tells you how, this one is sounds like nice summary to me.
Today I've decided and went one step further and write tests (I know they should be written in first place, but hey at least I'm writing documentation first).
So I went to perldoc Test::More and after some reading this line has stopped me:
"STOP! If you’re just getting started writing tests, have a look at Test::Simple first."
Ok, move on to perldoc Test::Simple :
"** If you are unfamiliar with testing read Test::Tutorial first! **"
And finally this seems like the one to start. First sentence there is:
" AHHHHHHH!!!! NOT TESTING! Anything but testing!
Beat me, whip me, send me to Detroit, but don’t make me write tests!
*sob*
Besides, I don’t know how to write the damned things.".
I feel like home now, anyway don't let that scare you, writing tests in Perl is actually easy in the end.
Subscribe to:
Posts (Atom)