Last line of file/Perl

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: JD Austin
日付:  
題目: Last line of file/Perl
> I need to open a file and just read in the last line, can anyone
> throw me a bone?
>
> v/r
> -Mike
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Heres a snippet that just opens a file and prints the contents:

open (INFILE,"< $file") or die "Can't open $file file!\n";
while (<INFILE>){
$line=$_;
print $line;
}