Oct 19, 2001 #1 sauser Programmer Aug 22, 2001 49 US Is it possible in Perl to read by blocks not by lines?
Oct 19, 2001 #2 latch Programmer Jun 26, 2001 89 DE Im not sure if this is what you want .... ============================================== open(FILEHANDLE,"file_to_read" or die "Line X"; # Reading 1k at a time undef $buffer; while(FILEHANDLE,$buffer,1024) { # do something } close (FILEHANDLE); ============================================== regards C "Brahmaiva satyam" -Adi Shankara (788-820 AD) Upvote 0 Downvote
Im not sure if this is what you want .... ============================================== open(FILEHANDLE,"file_to_read" or die "Line X"; # Reading 1k at a time undef $buffer; while(FILEHANDLE,$buffer,1024) { # do something } close (FILEHANDLE); ============================================== regards C "Brahmaiva satyam" -Adi Shankara (788-820 AD)
Oct 22, 2001 #3 tsdragon Programmer Dec 18, 2000 5,133 US latch, I think you're missing a verb in the while condition. Shouldn't you have a read in there? Code: $blksize = 1024; while ( read FILEHANDLE, $buffer, $blksize ) { # do something } Tracy Dryden tracy@bydisn.com http://www.bydisn.com Meddle not in the affairs of dragons, For you are crunchy, and good with mustard. Upvote 0 Downvote
latch, I think you're missing a verb in the while condition. Shouldn't you have a read in there? Code: $blksize = 1024; while ( read FILEHANDLE, $buffer, $blksize ) { # do something } Tracy Dryden tracy@bydisn.com http://www.bydisn.com Meddle not in the affairs of dragons, For you are crunchy, and good with mustard.