in reply to string and sysread and read work differently

It would be simpler to use the buffered operations for this. That gives you automatic record seperator detection:

my $string { local $/ = "\n"; open my $fle, '<', $filepath or die $!; seek $fle, $offset, 0 or die $!; $string = <$fle>; close $fle or die $!; }
You could position without seek by first reading a dummy line with local $/ = \$offset;, but that is unnecessarily opaque.

After Compline,
Zaxo