URI::data(3)
π NAME π
okay so bestie, welcome to the URI::data(3) page from the User Contributed Perl Documentation β and it's literally URI::data β URI that contains immediate data π
β¨
πΈ SYNOPSIS πΈ
here's the group-chat-ready code, no cap:
use URI;
$u = URI->new("data:");
$u->media_type("image/gif");
$u->data(scalar(`cat camel.gif`));
print "$u\n";
open(XV, "|xv -") and print XV $u->data;
π¦ DESCRIPTION π¦
The URI::data class supports URI objects belonging to the data URI scheme. The data URI scheme is specified in RFC 2397. It allows inclusion of small data items as "immediate" data, as if it had been included externally. Examples:
data:,Perl%20is%20good
data:image/gif;base64,R0lGODdhIAAgAIAAAAAAAPj8+CwAAAAAI
AAgAAAClYyPqcu9AJyCjtIKc5w5xP14xgeO2tlY3nWcajmZZdeJcG
Kxrmimms1KMTa1Wg8UROx4MNUq1HrycMjHT9b6xKxaFLM6VRKzI+p
KS9XtXpcbdun6uWVxJXA8pNPkdkkxhxc21LZHFOgD2KMoQXa2KMWI
JtnE2KizVUkYJVZZ1nczBxXlFopZBtoJ2diXGdNUymmJdFMAADs=
URI objects belonging to the data scheme support the common methods (described in URI) and the following two scheme-specific methods:
$uri->media_type( [$new_media_type] )β can be used to get or set the media type specified in the URI. If no media type is specified, then the defaulttext/plain;charset=US-ASCIIis returned. π$uri->data( [$new_data] )β can be used to get or set the data contained in the URI. The data is passed unescaped (in binary form). The decision about whether to base64 encode the data in the URI is taken automatically, based on the encoding that produces the shorter URI string. π₯
π«Ά SEE ALSO π«Ά
URI β that's it, that's the see-also, periodt π
π COPYRIGHT π
Copyright 1995-1998 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bye bestie π β this page is from perl v5.42.0, dated 2026-09-02, and it's literally the URI::data(3) manual page. mwah π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-URI 5.310.0-160000.3.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms