Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by kyle (Abbot)
on Aug 27, 2008 at 19:20 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://707265]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-23 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found