tell function

来源:互联网 发布:动态测频软件 编辑:程序博客网 时间:2024/06/07 18:15

语法 :tell FH 或 tell (FN)


主要记录文件当前读取的位置。


DATA

aaa bbb cccddd eee 

CODE

#!usr/bin/perl -wopen(F, "+<", "C:/Users/liuweic/Desktop/seek.txt") or die "can't open the file:$!";while(<F>){print $_;print tell F;print "\n";}close(F);

RESULT

aaa bbb ccc13ddd eee 23

注意:转载或复制本文,请注明出处和作者,作者:No. Liu

原创粉丝点击