Code:
#!/usr/local/bin/perl
print "content-type: text/html\n\n";
open (FILE, "< file.txt") or die("File not found");
seek FILE, 21,0;
while(<FILE>)
{
print;
}
close(FILE);
exit;
|
Newbie Member
|
|
| 2Dec2008,23:58 | #1 |
|
So I'm trying to use the seek function to seek a couple of lines of the file without going to the end of the file. Just trying to stay within a certain byte range. Here is my code.
Code:
#!/usr/local/bin/perl
print "content-type: text/html\n\n";
open (FILE, "< file.txt") or die("File not found");
seek FILE, 21,0;
while(<FILE>)
{
print;
}
close(FILE);
exit;
|
|
Team Leader
|
![]() |
| 8Jan2009,16:00 | #2 |
|
Code: Perl
http://perldoc.perl.org/functions/seek.html |