Use the diamond operator to read from an opened file handle:
open my $FH, '<', '/path/to/spool.txt' or die $!;
while (my $line = <$FH>) {
print "I've read: $line";
}
close $FH;
More Related Contents:
- Operators in Perl [closed]
- Perl – Global symbol $DIR requires explicit package name (why can’t I print the output?) [closed]
- perl XML::Simple print issue [closed]
- What’s the easiest way to install a missing Perl module?
- How do I use boolean variables in Perl?
- Doesn’t Perl include current directory in @INC by default?
- Why does my file content/user input not match? (missing chomp canonical) [duplicate]
- What is the best way to slurp a file into a string in Perl?
- Scalar vs List Assignment Operator
- How can I check if a Perl array contains a particular value?
- How do you capture stderr, stdout, and the exit code all at once, in Perl?
- How to fix a locale setting warning from Perl
- How can I fire and forget a process in Perl?
- What’s the best way to make a deep copy of a data structure in Perl?
- What is the difference between new Some::Class and Some::Class->new() in Perl?
- Iterating hash based on the insertion order?
- Why can’t I match my string from standard input in Perl?
- How do I choose a package name for a custom Perl module that does not collide with builtin or CPAN packages names?
- What’s broken about exceptions in Perl?
- Delete ClearCase Views Script
- How to pass a variable from a child process (fork by Parallel::ForkManager)?
- What’s the difference between single and double quotes in Perl?
- How do I get the full path to a Perl script that is executing?
- Perl subroutine arguments
- What does the function declaration “sub function($$)” mean?
- How to create recursive hash of hash ? (With unlimited deep)
- How can I call a shell command in my Perl script?
- Which cpan installer is the right one? (CPAN.pm/CPANPLUS/cpanminus)
- How can I extract text from a PDF file in Perl?
- How do I retrieve the terminal width in Perl?