So my wife and I are expecting our first baby. Today in fact, although it looks as though she will be a bit late.
I got tired of trying to figure out which button did what on the little digital watch we were trying to use to time contractions, so I threw this together. There is obviously room for improvement (or even golfing), but something tells me that I should be doing something else right about now...
#!/usr/bin/perl -w use strict; use warnings; my $last = time; while( <> ) { my $time = time; my $interval = $time - $last; print localtime($time)." ($interval)"; $last = $time; }
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Giving birth with perl
by rhesa (Vicar) on Jul 28, 2006 at 01:47 UTC | |
|
Re: Giving birth with perl
by bart (Canon) on Jul 28, 2006 at 13:38 UTC | |
by jasonk (Parson) on Jul 29, 2006 at 15:03 UTC | |
by ikegami (Patriarch) on Jul 31, 2006 at 23:03 UTC | |
|
Re: Giving birth with perl
by Zero_Flop (Pilgrim) on Aug 06, 2006 at 15:38 UTC | |
by OfficeLinebacker (Chaplain) on Aug 26, 2006 at 00:47 UTC | |
|
Re: Giving birth with perl
by Anonymous Monk on Jul 31, 2006 at 22:33 UTC |