the sub that creates the mini page } opendir(SPAM,$spam_dir); my @files=readdir(SPAM); close(SPAM); my @deleted=grep(/^deleted/,@files); my $new=$mw->Toplevel; $new->title("List of Files"); foreach $open (@deleted) { $temp{$open}=$new->Button(-text=>"$open", -command=>sub{&view($open)}, -fg=>'black', -bg=>'tan')->pack; } } sub view { ($file)=@_; my $new=$mw->Toplevel; $new->title("$file Listing"); $open_curr=$new->Scrolled("Text")->pack(-side=>'bottom', -fill=>'both',-expand=>1); open (FH,"$file"); my @temp=; close(FH); foreach $line (@temp) { $open_curr->insert("end",$line); } }