SHORTEN(1)

πŸ“¦ version 3.094, in fedora 43

πŸ‘‘ 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 --service command line option 🌸
  • the value of the SHORTEN_SERVICE environment variable πŸ¦‹
  • the value of the service option 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 🌟


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