#!perl use strict; use warnings; use utf8; use Pod::Html; use Tk; use Tk::LabEntry; use FindBin qw/$Bin/; my $mw = tkinit(); my $selection_frame = $mw->Frame()->pack(-fill => 'x'); my $e = $selection_frame->LabEntry( -label => 'POD file:', -labelPack => [-side => 'left'], -bg => 'white', )->pack(-side => 'left', -fill => 'x', -expand => 1); my $selbtn = $selection_frame->Button( -text => '...', -command => sub{ my @valid_types = ( ['Perl modules', '.pm'], ['POD files', '.pod'], ['All files', '*.*'], ); my $file = $mw->getOpenFile( -filetypes => \@valid_types, -initialdir => $Bin, ); if( $file ) { # a file has been chosen $e->delete(0, 'end'); $e->insert(0, $file); } }, )->pack(); my $convert_btn = $mw->Button( -text => 'convert', -command => sub{ my $infile = $e->get(); my $outfile = $infile . '.html'; Pod::Html::pod2html("pod2html", "--infile=\"$infile\"", "--outfile=\"$outfile\"" ); }, )->pack(-fill => 'x',); $mw->MainLoop(); exit(0); # exit normally (0)