Help for this page

Select Code to Download


  1. or download this
    my $dir = "/Path/to/a/data/directory";
    my %hash;
    ...
    
        return { $key => \@values };
    }
    
  2. or download this
    my $dir = "/Path/to/a/data/directory";
    my %hash;
    ...
        %{$hash{$file}} = (%{$hash{$file}}, %{hashify_line( $line )});
    }
    close $grep_fh or die "Error closing grep pipe: $!\n";
    
  3. or download this
    my $cmd = "find $dir -type f -print | xargs grep '^' /dev/null";
    open my $grep_fh, '-|', $cmd
        or die "Can't grep: $!\n";