Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
Perl Programming

Read a Text File

 

Top Ten Programs

Read a Text File
You can open a text file and read each line.

1. [ Perl ] Reading lines


Big

The text file haggis.txt includes some lines of text.

Note that the end of line character is included. The chomp method removes this character (on windows this is two characters).