Pages

Friday, April 20, 2012

read text file and store line in array



if (-e $file )
{
open(ori, $file);
while( my $line = )
{
if ($line =~ m/^connect/i)
{
push(@array,$line)
}
}
}
else
{
print" cannot find the file";
}


reference
1.http://stackoverflow.com/questions/1512729/how-can-i-search-multiple-files-for-a-string-in-perl

0 comments:

 

site weekly hits