IP::Cou...::Medium(3)

πŸ“¦ version 2.28, in opensuse-leap 16.0

✨ NAME ✨

Okay bestie, the manual we're reading is IP::Cou...::Medium(3) (from User Contributed Perl Documentation), and it's all about IP::Country::Medium β€” a cached lookup of country codes by IP address and domain name. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

use IP::Country::Medium;

🌸 DESCRIPTION 🌸

First thing: see the documentation for IP::Country. Like, go read that one too. πŸ’–

In addition, IP::Country::Medium objects have a cache() method. It controls whether hostname->cc lookups are cached β€” and it's on by default. Slay.

πŸ’… $ic->cache(BOOLEAN) πŸ’…

By default, the module caches results of country-code lookups. You can switch this feature off by setting cache to a false value β€” that's zero, empty string, or undef β€” and switch it back on by setting cache to a true value (anything which isn't false). Literally anything not false. 😭

$ic->cache(0); # clears and disables cache
$ic->cache(1); # enables the cache
Heads up, bestie: the cache is formed at the class level, so any change in caching in one object will affect all objects of this class. Turning off the cache also clears the cache. No cap. πŸ‘‘

And that's the whole vibe. This iconic little page was brought to you by perl v5.42.0 and dated 2015-04-14 β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from