HTML::O...FileList(3)
π HTML::Object::DOM::FileList(3) β like, the FileList class, bestie
okay so this is the HTML Object DOM FileList class, straight out of the User Contributed Perl Documentation section of your man pages. she's niche, she's useful, she's giving file-management main character energy ποΈβ¨
πΈ SYNOPSIS πΈ
use HTML::Object::DOM::FileList;
my $list = HTML::Object::DOM::FileList->new ||
die( HTML::Object::DOM::FileList->error, "\n" );
<input id="fileItem" type="file" />
my $file = $doc->getElementById('fileItem')->files->[0];
like yes that's it, that's the whole vibe check π«Ά
β VERSION β
v0.2.0
she's on version v0.2.0, we stan a specified version number π
π¦ DESCRIPTION π¦
so basically: an object of this type is returned by the "files" property in HTML::Object::DOM::Element::Input, which lives on the HTML <input> element. what that means for you is you get a whole list of files β the ones you set, added, removed, etc. β and it's all right there. she inherits from Module::Generic::Array, so you already know the array vibes are immaculate π₯
normally (like, in JavaScript land) those files are the ones people pick with the <input type="file" /> element. it's also used on the web for the list of files you get when someone drops stuff into web content using the drag and drop API β check the DataTransfer object on Mozilla for the deets on that usage, iykyk π
π PROPERTIES π
length
read-only, no cap. π
returns the number of files in the list. that's it. that's the property. count 'em π
β¨ METHODS β¨
item
returns a HTML::Object::DOM::File object representing the file sitting at the specified index in the file list. like, "give me file number whatever" and she delivers π§
example, because we love a demo:
# fileInput is an HTML input element: <input type="file" id="myfileinput" multiple />
my $fileInput = $doc->getElementById("myfileinput");
# files is a FileList object (similar to NodeList)
my $files = $fileInput->files;
my $file;
# loop through files
for( my $i = 0; $i < $files->length; $i++ )
{
# get item
$file = $files->item($i);
# or
$file = $files->[$i];
say( $file->name );
}
notice how you can hit ->item($i) or just go straight ->[$i] like a boss β both slay, both get you the file π
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β the icon behind all this π
π₯ SEE ALSO π₯
- Mozilla documentation β <https://developer.mozilla.org/en-US/docs/Web/API/FileList>
go read it, she's thorough π
πΈ COPYRIGHT & LICENSE πΈ
Copyright(c) 2021 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
fr fr go build something cute with your files, bestie π
okay that's the whole page!! and for the lil sign-off: this beauty was generated by perl v5.42.2 on 2026-02-15 β the HTML::O...FileList(3) page, truncated title and all, periodt πβ¨
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms