Perl讀寫(xiě)文件簡(jiǎn)單示例
更新時(shí)間:2015年04月14日 09:28:12 投稿:junjie
這篇文章主要介紹了Perl讀寫(xiě)文件簡(jiǎn)單示例,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下
!/usr/bin/perl -w use strict; #print "please input a string\n"; #my $line = <STDIN>; #print $line; #wirte a file open(FH, ">aa.txt") or die $!; print FH "hello\n";#向文件寫(xiě)入內(nèi)容 print FH "OK\n"; close(FH); #open a file open(FH, "aa.txt") or die $!; my @f = <FH>;#將文件內(nèi)容讀出 print @f; close(FH);
相關(guān)文章
Windows和Linux系統(tǒng)下perl連接SQL Server數(shù)據(jù)庫(kù)的方法
這篇文章主要介紹了Windows和Linux系統(tǒng)下perl連接SQL Server數(shù)據(jù)庫(kù)的方法,本文詳細(xì)的講解了Windows和Linux系統(tǒng)中perl如何連接Microsoft SQL Server數(shù)據(jù)庫(kù),需要的朋友可以參考下2014-10-10
perl腳本實(shí)現(xiàn)限制ssh最大登錄次數(shù)(支持白名單)
這篇文章主要介紹了perl腳本實(shí)現(xiàn)限制ssh最大登錄次數(shù),腳本支持支持白名單設(shè)置,例如root可以不限制登錄次數(shù),需要的朋友可以參考下2014-07-07

