Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: greater efficiency required (ls, glob, or readdir?)

by kyle (Abbot)
on Aug 27, 2008 at 19:20 UTC ( #707265=note: print w/replies, xml ) Need Help??

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";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://707265]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2020-11-28 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?