Found the page below after digging on google:
http://www.unix.org.ua/orelly/perl/prog3/ch09_01.htm
Then I test it with simple code, as below:
#!/usr/bin/perl
# to test reading a file, split it, then put it into array
use strict;
use warnings;
my $ref_line;
my @lines;
open FH,"testfile.txt";
while () {
push @lines, [split(" ",$_)];
}
for $ref_line (@lines) {
print "@$ref_line[7]\n";
}
The result looks OK to me. Now it's the time to write the code into my project.
No comments:
Post a Comment