EDIT: That being said,
system("sleep 0.02") == 0 or last
use Time::HiRes qw/sleep/;
It's already been used for all kind of stuff (https://projects.ardrone.org/boards/1/topics/show/491, ECG, etc).
1 - https://github.com/bradland/apache-bench-grapher
As the script from the OP, this is a tool to plot STDIN. This one has been refined far more, so it's trivial to use and very powerful.