Re: read I/O function

2001-10-25 Thread RaFaL Pocztarski
Nate Brunson wrote: > ok this is my delema, i am trying to read from this file using: > read(FILEHANDLE, $buffer, $size); You can get a file size using: $size = -s FILEHANDLE; or $size = -s "filename"; but you don't need to know the size if you just want to read the entire file into

RE: read I/O function

2001-10-25 Thread Moon, John
@size=stat FILEHANDLE; $size=$size[7]; Hope this helps ... Can this file get very big ? If so you may wish to re-consider what you are doing... If you are looking for one thing in the file you may wish to look into grep or egrep ... #! /usr/local/bin/perl $found = `egrep '^[0-9]+ bytes sent'