in reply to how to read data for every 280 character ?

You may wish to consider using read instead of grabbing whole lines.

Something like this untested code ought to do the trick.

my $data; read( $fh, $data, 280 ); #read in initial 280 bytes. while( my $count = $data =~ s/\n//g ) { read( $fh, $data, $count, length $data ); }


TGI says moo