Help for this page

Select Code to Download


  1. or download this
    # sub_program
    use strict;
    ...
         print "$i \n";
         sleep 3;
    }
    
  2. or download this
    # main program
    use strict;
    ...
         $last_line = $_ while <>;
         print "iteration $i : $last_line";
    }
    
  3. or download this
    $ perl  test_sub.pl
    iteration 0 : 3
    ...
    iteration 3 : 13
    iteration 4 : 16
    ...