my $fh = FileHandle->new("> program_ipc_file"); $fh->close; if (-f 'program_ipc_file') { $fh = FileHandle->new("tail -f -n 25 program_ipc_file|"); $widget->fileevent($fh, 'readable', sub {$me->_process_fileevent});