home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
perl_ste.zip
/
auto
/
Net
/
FTP
/
_extract_path.al
< prev
next >
Wrap
Text File
|
1997-11-28
|
569b
|
24 lines
# NOTE: Derived from ./blib/lib/Net/FTP.pm. Changes made here will be lost.
package Net::FTP;
##
## Private methods
##
sub _extract_path
{
my($ftp, $path) = @_;
# This tries to work both with and without the quote doubling
# convention (RFC 959 requires it, but the first 3 servers I checked
# didn't implement it). It will fail on a server which uses a quote in
# the message which isn't a part of or surrounding the path.
$ftp->ok &&
$ftp->message =~ /(?:^|\s)\"(.*)\"(?:$|\s)/ &&
($path = $1) =~ s/\"\"/\"/g;
$path;
}
1;