HTML::O...OM::File(3)
π NAME π
Ok bestie, this is the HTML::O...OM::File(3) manual page β User Contributed Perl Documentation, iykyk β and the actual class is HTML::Object::DOM::File, aka the HTML Object DOM File Class. Lowkey iconic. π
β¨
π SYNOPSIS π
use HTML::Object::DOM::File;
my $file = HTML::Object::DOM::File->new ||
die( HTML::Object::DOM::File->error, "\n" );
π¦ VERSION π¦
v0.2.0 β that's the version, bestie. Highkey slay. π
πΈ DESCRIPTION πΈ
The File interface is literally the info desk for files: it gives you information about files and lets you access their content. Obsessed. It's giving file-info realness, fr fr. π
Usually, File objects are retrieved from an HTML::Object::DOM::FileList object returned using the "<input"> files method.
It inherits from Module::Generic::File. Ngl, that's a nice little family tree. π³
π PROPERTIES π
Vibe check: every property down here is read-only, bestie. Don't try to write to them. π
π lastModified
Read-only.
Returns the last modified time of the file, in seconds since the UNIX epoch (January 1st, 1970 at Midnight), as a Module::Generic::DateTime object. The DateTime object stringifies to the seconds since epoch. The way that works is lowkey neat. β¨
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/lastModified
π lastModifiedDate
Read-only.
Returns the last modified date and time of the file referenced by the file object, as a Module::Generic::DateTime object.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/lastModifiedDate
π name
Read-only.
Returns the name of the file referenced by the file object.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/name
π¦ webkitRelativePath
Read-only.
Returns the relative file path.
Normally under JavaScript, this works alongside the "<input"> attribute webkitdirectory:
<input type="file" webkitdirectory />
...allowing a user to select an entire directory instead of just files. So, webkitRelativePath provides the relative file path to that directory uploaded. Cute, right? π«Ά
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath
π size
Read-only.
Returns the size of the file in bytes.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/size
β type
Read-only.
Returns the MIME type of the file, or undef if it cannot find it.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File/type
π₯ METHODS π₯
π§ arrayBuffer
Opens the file as "raw" data and returns its content as a scalar object.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Blob/arrayBuffer
π slice
Provided with a start and an end as a range, and an optional encoding, this returns that range of data from the file as a scalar object. If no encoding is provided, this will default to utf-8.
If you specify a negative start, it is treated as an offset from the end of the file's data toward the beginning. For example, -10 would be the "10th" from last byte in the file data. The default value is 0. If you specify a value for start that is larger than the size of the file, the returned scalar object has size 0 and contains no data.
The end specifies the offset (not the length) of the last byte, without including it, to include in the returned data. If you specify a negative end, it is treated as an offset from the end of the data toward the beginning. For example, -10 would be the "10th" from last byte in the file's data. The default value is the file size, i.e. until the end of the file's data.
Returns a new scalar object containing the data in the specified range of bytes of the file. Not me double-checking that end is an offset and not a length ππ
π stream
This opens the file and returns its file handle to read the file's contents. You could also do:
my $io = $file->open || die( $file->error );
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream
π text
Opens the file in utf-8 and returns its content as a scalar object.
See Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Blob/text
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β iconic author behavior, fr fr. π
π« SEE ALSO π«
Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/File
π 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.
Catch you later, bestie π β this HTML::O...OM::File(3) page is from perl v5.42.2, dated 2026-02-15. Slay! πβ¨
π¦ 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