sub refresh{ my @size = split "\n", `cat /proc/$pid/status`; (my $vmsize) = grep {/VmSize/} @size; my ($size) = $vmsize =~ /VmSize:\s+(.*)$/; # Changed this $t->configure(-text=>"PID: $pid -> $size"); if($size eq ''){Tk::exit} }