Help for this page

Select Code to Download


  1. or download this
    #        1         2         3         4
    #23456789012345678901234567890123456789012345
    perl -lne'$a[$.].=$_;$.=0if eof}{print for@a'
    
  2. or download this
       $. is reset when the filehandle is closed, but not when an open
       filehandle is reopened without an intervening close().  For
       more details, see "I/O Operators" in perlop.  Because "<>"
       never does an explicit close, line numbers increase across ARGV