in reply to Re: How do I read the contents of a file?
in thread How do I read the contents of a file?

Since this is a newbie tutorial, it may be worth explaining that the contents of the record read are available in the $_ variable, in the block "... do something here...".

For example, if you wanted to PRINT the file, you would say:

while (<$f>) { print $_; # $_ contains the record most recently read # The "$_" is implied if omitted, so you could simply # say: print; # # If you need to append a newline after each record, # use : print "$_\n"; }