#!/usr/bin/perl -w use Tk; my $mw =MainWindow ->new; $mw -> title ("Untitled"); $mw -> Button(-text => "S H O W", -command => \&show)->grid(-row => 0, -column => 0); $mw -> Button(-text => "E X I T", -command => sub {exit})->grid(-row => 0, -column => 1); $lb2 = $mw -> Scrolled('Listbox', -width=> 30, -height => 10, -selectmode => "single", -scrollbars => 'e', -setgrid =>1, -background => 'black', -foreground => 'white') -> grid (-row => 1, -column => 0); MainLoop; sub show { $lb2 -> delete(0,'end'); open(PIPE, "du -a 2>&1 |") or die "Could not open pipe: $!\n" ; while () { chop ($_) ; $lb2 -> insert('end',$_); } close(PIPE) ; } exit (0);