#!/usr/bin/perl my $i = 0; while (sysread(STDIN,$buf,$ENV{BLOCKSIZE})) { $i++; } print "Called read $i times.\n";