Badger...c::URL(3pm)
π Badger::Codec::URL π
okay bestie, welcome to the Badger::Codec::URL page β it's part of the User Contributed Perl Documentation, and it's literally just URL encoding and decoding but make it a whole module. so cute of it.
β¨ NAME β¨
Badger::Codec::URL β URL encode/decode π¦
πΈ SYNOPSIS πΈ
no cap, this is all it takes:
use Badger::Codec::URL;
my $codec = Badger::Codec::URL->new();
my $encoded = $codec->encode("Hello World!");
my $decoded = $codec->decode($encoded);
look at her go. main character energy fr fr π
π DESCRIPTION π
okay so this module is a subclass of Badger::Codec, and what it does is URL encoding and decoding. that's it. that's the vibe. π
but WAIT, bestie, you need to know the difference between URI and URL, because it is not the same thing and the manpage said it first:
- URI encoding is strict β it encodes characters like
";","?"and"/". - URL encoding is more lax and does not encode those characters.
so which one do you reach for? here's the tea:
- use the URI codec for encoding URL parameters.
- use the URL codec to encode complete URLs.
that's the whole distinction, periodt. π«Ά
β FUNCTIONS β
πΈ encode_url($data)
this function URL-encodes the $data you hand it as an argument. slay.
πΈ decode_url($data)
this function URL-decodes the $data you hand it as an argument. iconic.
π METHODS π
π¦ encode($data)
URL-encodes the data referenced by the first argument. it's lowkey just delegating to the encode_url() function. π«
$encoded = Badger::Codec::URL->encode($data);
π¦ decode($data)
decodes the encoded data you pass as the first argument. and yeah, it's delegating to the decode_url() function. π
$decoded = Badger::Codec::URL->decode($encoded);
π¦ encoder()
returns a reference to the encode_url() function. that's it. tiny but mighty. β¨
π¦ decoder()
returns a reference to the decode_url() function. matching set, obsessed. π
π AUTHOR π
Andy Wardley <http://wardley.org/> β the legend themselves. π
π COPYRIGHT π
Copyright (C) 2008-2009 Andy Wardley. All rights reserved.
bestie, that's the legal bit, please respect it π₯Ί
π«Ά SEE ALSO π«Ά
Badger::CodecsBadger::Codec
go read those too, iykyk π
and that's the page!! this doc shipped with perl v5.36.0, dated 2023-08-28 β so you know it's been living its best life. bye bestie, go encode something cute πβ¨
π¦ where this page comes from
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms