- 論壇徽章:
- 0
|
學(xué)習(xí)《perl網(wǎng)絡(luò)編程》時遇到的問題:- 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;
- }
復(fù)制代碼 不明白的地方stat(_)是什么意思,是不是打印錯誤了,應(yīng)該是stat($_)呢?可是這段代碼所在的程序又能正常運行 |
|