HTML::O...FileList(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’… 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 πŸ”₯

go read it, she's thorough πŸ“š


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