📜  perl mechanize 检查镜像响应是否有错误 - Perl 代码示例

📅  最后修改于: 2022-03-11 14:48:10.998000             🧑  作者: Mango

代码示例1
my $response = $mech->mirror($abs_url, $filename)->message;
            print Dumper($response); #print response: [OK, Not Found, Not Modified]
            if($response eq 'Not Found'){
                #responds code here to error trying to download.
            }
            if($response eq 'Not Modified'){
                #responds code here to unmodified download.
            }
            if($response eq 'OK'){
                #responds code here to download successfully.
            }