亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2509 | 回復(fù): 1
打印 上一主題 下一主題

求解釋!。 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-09-05 14:22 |只看該作者 |倒序瀏覽
本帖最后由 上官神速 于 2014-09-05 14:28 編輯

my $DRIVE_RX = '[a-zA-Z]:';
my $UNC_RX = '(?:\\\\\\\\|//)[^\\\\/]+[\\\\/][^\\\\/]+';
my $VOL_RX = "(?:$DRIVE_RX|$UNC_RX)";


sub catfile {
    shift;

    # Legacy / compatibility support
    #
    shift, return _canon_cat( "/", @_ )
        if $_[0] eq "";

    # Compatibility with File::Spec <= 3.26:
    #     catfile('A:', 'foo') should return 'A:\foo'.
    return _canon_cat( ($_[0].'\\'), @_[1..$#_] )
        if $_[0] =~ m{^$DRIVE_RX\z}o;

    return _canon_cat( @_ );
}





sub _canon_cat                                # @path -> path
{
    my ($first, @rest) = @_;

    my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x        # drive letter
                   ? ucfirst( $1 ).( $2 ? "\\" : "" )
               : $first =~ s{ \A (?:\\\\|//) ([^\\/]+)
                                 (?: [\\/] ([^\\/]+) )?
                                        [\\/]? }{}xs                        # UNC volume
               ? "\\\\$1".( defined $2 ? "\\$2" : "" )."\\"
               : $first =~ s{ \A [\\/] }{}x                        # root dir
               ? "\\"
               : "";
    my $path   = join "\\", $first, @rest;

    $path =~ tr#\\/#\\\\#s;                # xx/yy --> xx\yy & xx\\yy --> xx\yy

                                            # xx/././yy --> xx/yy
    $path =~ s{(?:
                (?:\A|\\)                # at begin or after a slash
                \.
                (?:\\\.)*                # and more
                (?:\\|\z)                 # at end or followed by slash
               )+                        # performance boost -- I do not know why
             }{\\}gx;

    # XXX I do not know whether more dots are supported by the OS supporting
    #     this ... annotation (NetWare or symbian but not MSWin32).
    #     Then .... could easily become ../../.. etc:
    # Replace \.\.\. by (\.\.\.+)  and substitute with
    # { $1 . ".." . "\\.." x (length($2)-2) }gex
                                             # ... --> ../..
    $path =~ s{ (\A|\\)                        # at begin or after a slash
                    \.\.\.
                (?=\\|\z)                 # at end or followed by slash
             }{$1..\\..}gx;
                                            # xx\yy\..\zz --> xx\zz
    while ( $path =~ s{(?:
                (?:\A|\\)                # at begin or after a slash
                [^\\]+                        # rip this 'yy' off
                \\\.\.
                (?<!\A\.\.\\\.\.)        # do *not* replace ^..\..
                (?<!\\\.\.\\\.\.)        # do *not* replace \..\..
                (?:\\|\z)                 # at end or followed by slash
               )+                        # performance boost -- I do not know why
             }{\\}sx ) {}

    $path =~ s#\A\\##;                        # \xx --> xx  NOTE: this is *not* root
    $path =~ s#\\\z##;                        # xx\ --> xx

    if ( $volume =~ m#\\\z# )
    {                                        # <vol>\.. --> <vol>\
        $path =~ s{ \A                        # at begin
                    \.\.
                    (?:\\\.\.)*                # and more
                    (?:\\|\z)                 # at end or followed by slash
                 }{}x;

        return $1                        # \\HOST\SHARE\ --> \\HOST\SHARE
            if    $path eq ""
              and $volume =~ m#\A(\\\\.*)\\\z#s;
    }
    return $path ne "" || $volume ? $volume.$path : ".";
}


其中的shift, return _canon_cat( "/", @_ )
        if $_[0] eq "";能解釋下嗎 my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x        # drive letter
                   ? ucfirst( $1 ).( $2 ? "\\" : "" )
               : $first =~ s{ \A (?:\\\\|//) ([^\\/]+)
                                 (?: [\\/] ([^\\/]+) )?
                                        [\\/]? }{}xs                        # UNC volume
               ? "\\\\$1".( defined $2 ? "\\$2" : "" )."\\"
               : $first =~ s{ \A [\\/] }{}x                        # root dir
               ? "\\"
               : "";ss{ \A ([A-Za-z]:) ([\\/]?) }{}x咋和s///不是同類的格式s{{{;

論壇徽章:
33
榮譽會員
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT運維版塊每日發(fā)帖之星
日期:2016-04-17 06:23:27操作系統(tǒng)版塊每日發(fā)帖之星
日期:2016-04-18 06:20:00IT運維版塊每日發(fā)帖之星
日期:2016-04-24 06:20:0015-16賽季CBA聯(lián)賽之天津
日期:2016-05-06 12:46:59
2 [報告]
發(fā)表于 2014-09-05 15:42 |只看該作者
  1. s{ \A ([A-Za-z]:) ([\\/]?) }{}x
  2. s/ \A ([A-Za-z]:) ([\\\/]?) //x
復(fù)制代碼
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP