http://www.perlmonks.org?node_id=500430


in reply to Get only 1KB from text File

Hi

User Input Record Separator ($/)

local $/=\"1024"; open FILE, 'c:\space\sp.txt' or die $!; $_=<FILE>; #<IT WILL READ ONLY 1KB>