Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by green_lakers (Novice)
on Jan 05, 2009 at 22:15 UTC ( [id://734299]=note: print w/replies, xml ) Need Help??


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

Hi there, I dont want to join 08 and 09 files together. At the first loop i need the 08 files where i will process only files and gererate a report. At the second loop i require the 09 files and output a report.

Replies are listed 'Best First'.
Re^3: Array problem......PLEASE HELP!
by zentara (Archbishop) on Jan 05, 2009 at 22:35 UTC
    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://734299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-18 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found