home *** CD-ROM | disk | FTP | other *** search
/ ftp.cse.unsw.edu.au / 2014.06.ftp.cse.unsw.edu.au.tar / ftp.cse.unsw.edu.au / pub / doc / languages / perl / nutshell / ch4 / eof < prev    next >
Encoding:
Text File  |  1992-10-18  |  187 b   |  18 lines

  1. while (<>) {
  2.     if (eof()) {
  3.         print "-" x 30, "\n";
  4.     }
  5.     print;
  6. }
  7.  
  8. while (<>) {
  9.     print "$.\t$_";
  10.     if (eof) {      # Not eof().
  11.         close(ARGV);
  12.     }
  13. }
  14.  
  15. while (<>) {
  16.     print if /pattern/..eof;
  17. }
  18.