SHORTEN(1)
π SHORTEN(1) β bestie's guide to the shorten CLI π
okay so like. this is a page from the User Contributed Perl Documentation section, and it's about shorten(1) β a whole little command-line program whose entire job is to demonstrate how WWW::Shorten works. no cap, it's a demo with main character energy. π
β¨ NAME β¨
shorten β a CLI program that exists to show off WWW::Shorten π
π¦ SYNOPSIS π¦
here's the vibe, literally just watch:
# Default shortening service is Metamark
$ shorten books.perl.org/book/171
http://xrl.us/dv8
# Change with an environment variable
$ SHORTEN_SERVICE=TinyURL shorten books.perl.org/book/171
http://tinyurl.com/ye7gjf4
# Change with command line option
$ shorten --service=TinyURL books.perl.org/book/171
http://tinyurl.com/ye7gjf4
# Change using config file
$ cat ~/.shortenrc
service = TinyURL
$ shorten books.perl.org/book/171
http://tinyurl.com/ye7gjf4
# Lengthen a URL
$ shorten -l http://tinyurl.com/ye7gjf4
not me being obsessed with the fact that it can lengthen too π the -l flag is out here un-shortening things and honestly? iconic.
π CONFIGURATION π
so which service does it use?? it's giving β¨detective workβ¨ because the program checks a bunch of places and grabs the first value it finds, in this exact order:
- the value of the
--servicecommand line option πΈ - the value of the
SHORTEN_SERVICEenvironment variable π¦ - the value of the
serviceoption from the configuration file (peep below π) - and if none of those exist? it just defaults to Metamark. periodt. π
π CONFIGURATION FILE π
okay so because it uses the Config::Auto module for config, shorten is lowkey super flexible about format. no rules, just vibes. π
it'll look in whichever of these files shows up first:
shortenconfig
~/shortenconfig
/etc/shortenconfig
shorten.config
~/shorten.config
/etc/shorten.config
shortenrc
~/shortenrc
/etc/shortenrc
.shortenrc
~/.shortenrc
/etc/.shortenrc
generally, the author uses this format:
service = MakeAShorterLink
which is simple and it works, fr fr. π«Ά
service is the only configuration keyword at present. its value should be a correctly capitalized service name, as per WWW::Shorten's documentation. so like, capitalize it properly bestie, don't be out here guessing π
π LICENSE AND COPYRIGHT π
Copyright 2002 - 2010, Magnum Solutions Ltd. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
πΈ AUTHOR πΈ
Iain Truskett <spoon@cpan.org>
β CONTRIBUTORS β
- Chase Whitener
capoeirab@cpan.org - Dave Cross <davecross@cpan.org>
π₯ SEE ALSO π₯
WWW::Shorten
and that's the whole thing bestie!! π§ this was shorten(1) from perl v5.42.0, dated 2025-07-25, and honestly it ate. go shorten something. mwah ππ
π¦ where this page comes from
- fedora 43: perl-WWW-Shorten 3.094-13.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms