use Path::Tiny 'path'; my $file_path = '/foo/bar/baz.txt'; # if no memory concern, slurp: my @lines = path( $file_path )->lines_utf8({chomp => 1}); # or read from a filehandle line-by-line: my $fh = path( $file_path )->openr_utf8; while ( my $line = <$fh> ) { chomp $line; ... }