曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.かつては雑草やヨモギと共に雨や露を分かち合っていたが、今では松やヒノキと共に霜や雪に耐えている。曾与蒿藜同雨露,Once sharing rain and dew with weeds and wormwood, now enduring frost and snow with pines and cypresses.终随松柏到冰霜.曾与蒿藜同雨露한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.,终随松柏到冰霜.譖セ荳手珍阯懷酔髮ィ髴イ�檎サ磯囂譚セ譟丞芦蜀ー髴�曾与蒿藜同雨露,鏇句笌钂胯棞鍚岄洦闇诧紝缁堥殢鏉炬煆鍒板啺闇�终随松柏到冰霜.曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.曾与蒿藜同雨露,终随松柏到冰霜.
package URI::Split;
use strict;
use vars qw(@ISA @EXPORT_OK);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(uri_split uri_join);
use URI::Escape ();
sub uri_split {
return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,;
}
sub uri_join {
my($scheme, $auth, $path, $query, $frag) = @_;
my $uri = defined($scheme) ? "$scheme:" : "";
$path = "" unless defined $path;
if (defined $auth) {
$auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg;
$uri .= "//$auth";
$path = "/$path" if length($path) && $path !~ m,^/,;
}
elsif ($path =~ m,^//,) {
$uri .= "//"; # XXX force empty auth
}
unless (length $uri) {
$path =~ s,(:), URI::Escape::escape_char($1),e while $path =~ m,^[^:/?\#]+:,;
}
$path =~ s,([?\#]), URI::Escape::escape_char($1),eg;
$uri .= $path;
if (defined $query) {
$query =~ s,(\#), URI::Escape::escape_char($1),eg;
$uri .= "?$query";
}
$uri .= "#$frag" if defined $frag;
$uri;
}
1;
__END__
=head1 NAME
URI::Split - Parse and compose URI strings
=head1 SYNOPSIS
use URI::Split qw(uri_split uri_join);
($scheme, $auth, $path, $query, $frag) = uri_split($uri);
$uri = uri_join($scheme, $auth, $path, $query, $frag);
=head1 DESCRIPTION
Provides functions to parse and compose URI
strings. The following functions are provided:
=over
=item ($scheme, $auth, $path, $query, $frag) = uri_split($uri)
Breaks up a URI string into its component
parts. An C<undef> value is returned for those parts that are not
present. The $path part is always present (but can be the empty
string) and is thus never returned as C<undef>.
No sensible value is returned if this function is called in a scalar
context.
=item $uri = uri_join($scheme, $auth, $path, $query, $frag)
Puts together a URI string from its parts.
Missing parts are signaled by passing C<undef> for the corresponding
argument.
Minimal escaping is applied to parts that contain reserved chars
that would confuse a parser. For instance, any occurrence of '?' or '#'
in $path is always escaped, as it would otherwise be parsed back
as a query or fragment.
=back
=head1 SEE ALSO
L<URI>, L<URI::Escape>
=head1 COPYRIGHT
Copyright 2003, Gisle Aas
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=cut