- 论坛徽章:
- 0
|
学习《perl网络编程》时遇到的问题:- sub get_file {
- my ($path,$mode) = @_;
- my $rtime = $ftp->mdtm($path);
- my $rsize = $ftp->size($path);
- $mode = (parse_listing($ftp->dir($path)))[2] unless defined $mode;
- my ($lsize,$ltime) = stat($path) ? (stat(_))[7,9] : (0,0); <==================== 这里不明白
- if ( defined($rtime) and defined($rsize)
- and ($ltime >= $rtime)
- and ($lsize == $rsize) ) {
- warn "Getting file $path: not newer than local copy.\n" if $VERBOSE;
- return;
- }
- warn "Getting file $path\n" if $VERBOSE;
- $ftp->get($path) or (warn $ftp->message,"\n" and return);
- chmod $mode,$path if $mode;
- }
复制代码 不明白的地方stat(_)是什么意思,是不是打印错误了,应该是stat($_)呢?可是这段代码所在的程序又能正常运行 |
|