Help for this page

Select Code to Download


  1. or download this
    $ cat infile1.txt
    line1
    ...
    line3
    line4
    line2
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
    map { chomp; $hash{ $_ }++ } <IN>;
    close($in);
    print Dumper \%hash;
    
  3. or download this
    Output:
    $VAR1 = {
    ...
              'line4' => 1,
              'line1' => 2
            };