use strict; use warnings; use Time::HiRes qw(time); use POSIX qw(strftime); timestamp(); my $fred = `echo plenty of fish`; timestamp(); warn $fred; timestamp(); open my $fh, 'echo ' . $fred . ' |'; $fred = <$fh>; close $fh; timestamp(); warn $fred; timestamp(); sub timestamp { my $t = time; my $date = strftime "%Y%m%d %H:%M:%S", localtime $t; $date .= sprintf ".%03d", ($t-int($t))*1000; print $date, "\n"; }