Term::...Select(3pm)
π Term::...Select(3pm) β the Term::Clui::FileSelect era π
okay bestie, welcome to the manual page for Term::Clui::FileSelect β a Perl module that literally just asks a human to pick a file off the filesystem. sit down, hydrate, let's go π¦
β¨ NAME β¨
Term::Clui::FileSelect β a Perl module to ask the user to select a file. no cap, that's the whole job. π
πΈ SYNOPSIS πΈ
use Term::Clui::FileSelect;
$file = &select_file(-Readable=>1, -TopDir=>"/home", -FPat=>"*.html");
@files = &select_file(-Chdir=>0, -Path=>$ENV{PWD}, -FPat=>"*.mp3");
chdir &select_file(-Directory=>1, -Path=>$ENV{PWD});
π DESCRIPTION π
so here's the vibe: this module asks the user to select a file from the filesystem. it does that by talking to them through the command-line user-interface Term::Clui. it ships with Rescan and ShowAll buttons because we're thoughtful like that. π
and to ease the re-learning burden for the programmer (that's you, bestie π«Ά), the options are modelled on those of Tk::FileDialog and Tk::SimpleFileSelect β but with a bunch of new options introduced, namely -TopDir, -TextFile, -Readable, -Writeable, -Executable, -Owned and -Directory. new options, who dis. β¨
Multiple choice is possible in a limited circumstance; when file_select is invoked in a list context, with -Chdir=>0 and without -Create. and it is currently not possible to select multiple files lying in different directories. one directory at a time, babes, that's the boundary. π
π SUBROUTINES π
select_file( %options );
π OPTIONS π
-Chdirβ lets the user change directories. default is1. and if you set it to0, andselect_fileis invoked in a list context, and-Createis not set, then the user can select multiple files. three conditions, all of them, no exceptions. π¦-Createβ lets the user specify a file that does not exist. default is0. manifesting a file into existence, iconic honestly. β¨-ShowAllor-dotfilesβ determines whether hidden files (.*) are displayed. default is0. π-DisableShowAllβ takes away the user's ability to change the status of the ShowAll flag. default is0, i.e. the user is by default allowed to change the status. so like, by default they can touch it. π-SelDirβ if True, enables selection of a directory rather than a file. default is0. but if you want to enforce selection of a directory, use the-Directoryoption instead. different tool, different job, iykyk. π-FPator-filterβ sets the default file selection pattern, in glob format, e.g.*.html. only files matching this pattern will be displayed. want multiple patterns? you can use formats like*.[ch]or{*.cgi,*.pl}β seeFile::Globfor more details. default is"*". glob girlies rise π-Fileβ the file selected, or the default file. the default default is whatever the user selected last time in this directory. it remembers. it's giving memory. π§-Pathor-initialdirβ the path of the selected file, or the initial path. default is$ENV{HOME}. home sweet home. π-Titleβ the Title of the dialog box. if-Titleis specified, thenClui::FileSelectdynamically appends"in /where/ever"to it. if-Titleis not specified,Clui::FileSelectdisplays"in directory /where/ever". either way you're getting a where/ever, that's just the deal. π-TopDirβ restricts the user to remain within a directory or its subdirectories. default is"/". this option, and the following ones, are not offered byTk::FileDialog. we're built different. π₯-TextFileβ only text files will be displayed. default is0. π-Readableβ only readable files will be displayed. default is0. π-Writeableβ only writeable files will be displayed. default is0. βοΈ-Executableβ only executable files will be displayed. default is0. β‘-Ownedβ only files owned by the current user will be displayed. this is useful if the user is being asked to choose a file for achmodorchgrpoperation, for example. default is0. mine, mine, all mine π-Directoryβ only directories will be displayed. default is0. π
π BUGS π
three problem filenames will, if present in your file-system, cause confusion. they are: -Create New File-Show DotFiles-Hide DotFiles
so like... if you have those files, godspeed bestie. not our fault, but also, sorry. π
π«Ά AUTHOR π«Ά
Original author:
Peter J Billam β www.pjb.com.au/comp/contact.html
Current maintainer:
Graham Ollis
π CREDITS π
based on an old Perl4 library, filemgr.pl, with the options modelled after Tk::FileDialog and Tk::SimpleFileSelect. we stand on the shoulders of legends, fr fr. β¨
π SEE ALSO π
http://www.pjb.com.au/http://search.cpan.org/~pjbFile::GlobTerm::CluiTk::FileDialogTk::SimpleFileSelectperl(1)
and that's the whole page, bestie!! this was rendered from perl v5.30.0, dated 2019-11-10 β so yes, it's vintage, and yes, it still slays. go pick a file. periodt. π ππ¦
π¦ where this page comes from
- debian bookworm: libterm-clui-perl 1.76-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libterm-clui-perl 1.76-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libterm-clui-perl 1.76-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libterm-clui-perl 1.76-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms