URI::Heuristic(3)
β¨ NAME β¨
okay bestie, this is the manual page for URI::Heuristic β Expand URI using heuristics π
π¦ SYNOPSIS π¦
vibe check, here's the whole flex:
use URI::Heuristic qw(uf_uristr);
$u = uf_uristr("example"); # http://www.example.com
$u = uf_uristr("www.sol.no/sol"); # http://www.sol.no/sol
$u = uf_uristr("aas"); # http://www.aas.no
$u = uf_uristr("ftp.funet.fi"); # ftp://ftp.funet.fi
$u = uf_uristr("/etc/passwd"); # file:/etc/passwd
πΈ DESCRIPTION πΈ
This module gives you functions that expand strings into real absolute URIs using some built-in heuristics. Strings that already represent absolute URIs β i.e. the ones that start with a "scheme:" part β are never modified and are returned unchanged. The main use of these functions is to allow abbreviated URIs similar to what many web browsers allow for URIs typed in by the user. literally browser behavior, but make it Perl π
The following functions are provided:
uf_uristr($str) β¨
Tries to make the argument string into a proper absolute URI string. The "uf_" prefix stands for "User Friendly". Under MacOS, it assumes that any string with a common URL scheme (http, ftp, etc.) is a URL rather than a local path. So don't name your volumes after common URL schemes and expect uf_uristr() to construct valid file: URL's on those volumes for you, because it won't. fr fr, it will not π
uf_uri($str) π¦
Works the same way as uf_uristr() but returns a "URI" object. iconic, no notes π
π ENVIRONMENT π
If the hostname portion of a URI does not contain any dots, then certain qualified guesses are made. These guesses are governed by the following environment variables:
COUNTRYβ the two-letter country code (ISO 3166) for your location. If the domain name of your host ends with two letters, then it is taken to be the default country. See alsoLocale::Country. geography but make it URI guessing πHTTP_ACCEPT_LANGUAGE,LC_ALL,LANGβ ifCOUNTRYis not set, these standard environment variables are examined and country (not language) information possibly found in them is used as the default country. iykyk, country not language πURL_GUESS_PATTERNβ contains a space-separated list of URL patterns to try. The stringACMEis for some reason used as a placeholder for the host name in the URL provided. Example:
URL_GUESS_PATTERN="www.ACME.no www.ACME.se www.ACME.com"
export URL_GUESS_PATTERN
Specifying URL_GUESS_PATTERN disables any guessing rules based on country. An empty URL_GUESS_PATTERN disables any guessing that involves host name lookups. so if you want zero guessing, you know what to do π«Ά
π COPYRIGHT π
Copyright 1997-1998, Gisle Aas
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
that's the whole page, bestie π«Ά β brought to you by User Contributed Perl Documentation, perl v5.42.0, dated 2026-09-02. periodt π
π¦ where this page comes from
- opensuse-leap 16.0: perl-URI 5.310.0-160000.3.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms