use warnings; use strict; open(my $Progress, '|-', qw/ zenity --title Explore --progress --percentage 0 --text Test --auto-close --auto-kill /) or die $!; $Progress->autoflush; foreach my $Percent ( qw{10 20 30 40 50 60 70 80 90 100} ) { sleep 2; print "DBG> ", $Percent, "\n"; print $Progress "$Percent\n"; print $Progress "# Test $Percent\n"; } close($Progress) or die $! ? $! : $?;