Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Array problem......PLEASE HELP!

by zentara (Archbishop)
on Jan 05, 2009 at 22:35 UTC ( [id://734306]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Array problem......PLEASE HELP!
in thread Array problem......PLEASE HELP!

Try this:
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; opendir(DIR, '.'); my @files = grep !/^\.{1,2}$/, readdir DIR; my @files8 = grep /08/, @files; my @files9 = grep /09/, @files; closedir DIR; print "@files\n"; my %commands; #maybe use a hash print "08 files\n"; foreach my $file (@files8){ $commands{'08'}{$file} = `ls -l|grep $file` } print "09 files\n"; foreach my $file (@files9){ $commands{'09'}{$file} = `ls -l|grep $file` } print Dumper([\%commands]);

I'm not really a human, but I play one on earth Remember How Lucky You Are

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found