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

Re^14: Comparing Values PER Sub-folder

by omegaweaponZ (Beadle)
on Sep 05, 2012 at 23:25 UTC ( #991971=note: print w/ replies, xml ) Need Help??


in reply to Re^13: Comparing Values PER Sub-folder
in thread Comparing Values PER Sub-folder

Yes, I think....I'm looking for a file count IN the sub-directories OF those directories, so yes. There are no files in test/test1 but there is 1 file in test/test1/A and one in test/test1/B, etc, etc. I'm trying to compare all A, B, C, D from the single test1 subfolder. Confusion at its best!

So it needs to descend into the enclosed directory of A, B, C, D just to grab those file counts, but it needs to compare and contrast each one as an array so it outputs a single true/false for test/test1 and test/test2, etc. Does that make sense? This is where I'm confused because I'm grabbing the full directory of each file but I just want comparison of its parent folder ONLY per folder.


Comment on Re^14: Comparing Values PER Sub-folder
Re^15: Comparing Values PER Sub-folder
by omegaweaponZ (Beadle) on Sep 06, 2012 at 00:32 UTC
    Would File::Basename help in this scenario?

    Err, looks like it does actually help...quite a bit! Here is the code I'm using:

    my $basedir = dirname($curDir); my @lines = read_file( $curFile ) ; my $numLines = @lines; push @{ $dirLines{$basedir} }, $numLines;
    From the previous code assigned to this, I can properly get a true/false from an if/else statement. I THINK I might be all set with this now, thank you again for all your help! Very informative and learned a lot

      Excellent, omegaweaponZ! Aren't the available modules just amazing? Your use of File::Basename makes a lot of sense. You've done well tackling this issue. And you're quite welcome...

      Take care.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-07-05 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls