my $file_handle = open(file.txt)
my $text;
while (read $file_handle, $buff, 1024) { $text = $buff }
read returns the number of characters read (0 when it's finished which will end the loop). I don't know of any generic "read" function, so it's up to you to define how many characters at a time and give the $buffer scalar to read into. it's just a different way of doing things
norkakn is a better resource than this comment