home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_ecbebd8d29ae2170ab3e12f61933f4b8
< prev
next >
Wrap
Text File
|
2000-03-23
|
5KB
|
116 lines
<HTML>
<HEAD>
<TITLE>uf_uristr - Expand URI using heuristics</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> uf_uristr - Expand URI using heuristics</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#environment">ENVIRONMENT</A></LI>
<LI><A HREF="#copyright">COPYRIGHT</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>uf_uristr - Expand URI using heuristics</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use URI::Heuristic qw(uf_uristr);
$u = uf_uristr("perl"); # <A HREF="http://www.perl.com">http://www.perl.com</A>
$u = uf_uristr("www.sol.no/sol"); # <A HREF="http://www.sol.no/sol">http://www.sol.no/sol</A>
$u = uf_uristr("aas"); # <A HREF="http://www.aas.no">http://www.aas.no</A>
$u = uf_uristr("ftp.funet.fi"); # <A HREF="ftp://ftp.funet.fi">ftp://ftp.funet.fi</A>
$u = uf_uristr("/etc/passwd"); # <A HREF="file:/etc/passwd">file:/etc/passwd</A></PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>This module provides functions that expand strings into real absolute
URIs using some builtin heuristics. Strings that already represent
absolute URIs (i.e. start with a <CODE>scheme:</CODE> part) are never modified
and are returned unchanged. The main use of these functions are to
allow abbreviated URIs similar to what many web browsers allow for URIs
typed in by the user.</P>
<P>The following functions are provided:</P>
<DL>
<DT><STRONG><A NAME="item_uf_uristr"><CODE>uf_uristr($str)</CODE></A></STRONG><BR>
<DD>
The <A HREF="#item_uf_uristr"><CODE>uf_uristr()</CODE></A> function will try to make the string passed as argument
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 <A HREF="#item_uf_uristr"><CODE>uf_uristr()</CODE></A> to construct
valid file: URL's on those volumes for you, because it won't.
<P></P>
<DT><STRONG><A NAME="item_uf_uri"><CODE>uf_uri($str)</CODE></A></STRONG><BR>
<DD>
This functions work the same way as <A HREF="#item_uf_uristr"><CODE>uf_uristr()</CODE></A> but it will
return a <CODE>URI</CODE> object.
<P></P></DL>
<P>
<HR>
<H1><A NAME="environment">ENVIRONMENT</A></H1>
<P>If the hostname portion of a URI does not contain any dots, then
certain qualified guesses will be made. These guesses are governed be
the following two environment variables.</P>
<DL>
<DT><STRONG><A NAME="item_COUNTRY">COUNTRY</A></STRONG><BR>
<DD>
This is 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 also <A HREF="../../../site/lib/Locale/Country.html">the Locale::Country manpage</A>.
<P></P>
<DT><STRONG><A NAME="item_URL_GUESS_PATTERN">URL_GUESS_PATTERN</A></STRONG><BR>
<DD>
Contain a space separated list of URL patterns to try. The string
``ACME'' is for some reason used as a placeholder for the host name in
the URL provided. Example:
<PRE>
URL_GUESS_PATTERN="www.ACME.no www.ACME.se www.ACME.com"
export URL_GUESS_PATTERN</PRE>
<P>Specifying URL_GUESS_PATTERN disables any guessing rules based on
country. An empty URL_GUESS_PATTERN disables any guessing that
involves host name lookups.</P>
<P></P></DL>
<P>
<HR>
<H1><A NAME="copyright">COPYRIGHT</A></H1>
<P>Copyright 1997-1998, Gisle Aas</P>
<P>This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> uf_uristr - Expand URI using heuristics</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>