Convert::UU(3)
π Convert::UU(3) β the Perl module manual page, bestie edition π
okay so this is the manpage for Convert::UU, and it is genuinely one of the most useful little Perl modules out there β it does uuencode and uudecode, no cap. It lives in the User Contributed Perl Documentation section, and likeβ¦ we're about to read it together, so grab a snack π
β¨ NAME β¨
Convert::UU, uuencode, uudecode β a Perl module for uuencode and uudecode. That's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
here's how you actually call it, in all its glory:
use Convert::UU qw(uudecode uuencode);
$encoded_string = uuencode($string,[$filename],[$mode]);
($string,$filename,$mode) = uudecode($string);
$string = uudecode($string); # in scalar context
like, look at it. she's beautiful. three calls, zero drama π¦
π DESCRIPTION π
two functions, both iconic, both doing very different things. let's get into it π
π uuencode
uuencode() takes, as its first argument, a string that is to be uuencoded. and bestie, read this carefully β it is the string that is encoded, not a filename π like, please don't pass it a filename and expect file magic. it's a string.
alternatively (!!) you can pass a filehandle instead, but that handle must be opened for reading. no writing, no append, read-only energy only.
it returns the uuencoded string, and yes that includes the "begin" and "end" lines β you don't have to add those yourself, she comes fully dressed β¨
the second and third arguments are optional and specify the filename and the mode. if you don't specify them, they default to "uuencode.uu" and 644. defaults are the besties we didn't ask for but got anyway π«Ά
π uudecode
uudecode() takes a string as its argument, and that string is what gets uudecoded. simple.
but wait, there's more β if the argument is a filehandle, that handle gets read instead. and if it's a reference to an ARRAY? the elements are treated like lines that form a string. three ways to feed her, pick your fighter π
leading and trailing garbage will be ignored β she's unbothered, she's thriving, she simply does not see it π
the function returns the uudecoded string for the first begin/end pair. just the first one, okay? don't come at her with multiple pairs and expect a whole collection.
in array context, you get back an array where:
- the first element is the uudecoded string
- the second is the filename
- the third is the mode
three for the price of one, we love a multitasker β
π EXPORT π
both uudecode and uuencode live in @EXPORT_OK. so you gotta ask for them by name in your use line (see the synopsis, she showed you how). they're not coming out unless you invite them π
π§ AUTHOR π§
Andreas Koenig "ANDK@cpan.org". π
and with code integrated that was posted to USENET from Hans Mulder and Randal L. Schwartz. collab era, we love to see it πΈ
π₯ SEE ALSO π₯
these two are literally there for examples of how to use this module. if you're like "okay but how do I actually use this in real life", go read those. iykyk π¦
π COPYRIGHT π
Copyright 1996-2003 Andreas Koenig.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Based on code posted to comp.lang.perl by Hans Mulder and Randal L. Schwartz.
so yeah β free software, same terms as Perl itself, and a whole lineage of people who made it happen. respect the ancestors π«‘
ngl the licensing bit matters, bestie β if you're redistributing or modifying, you're doing it under the same terms as Perl itself. periodt.
and that's the whole page!! from perl v5.32.1, dated 2024-01-25 β this edition of the Convert::UU(3) manpage said what it said, and it ate π
β¨ no notes, go uuencode something π
π¦ where this page comes from
- epel 9: perl-Convert-UU 0.5201-37.el9 Β· 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