Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

poj's scratchpad

by poj (Parson)
on Jun 12, 2013 at 17:16 UTC ( #1038520=scratchpad: print w/ replies, xml ) Need Help??

#!/usr/bin/perl use strict; use warnings; use Data::Dump 'pp'; use File::Basename; my %hrefdata = ( file1 => 'account', file2 => 'process', file3 => 'numbers', file4 => 'names', ); #my @files = grep { -f } glob( 'data/*.txt' ); # content of @files my @files = ( "dir/file1_2016-04-05.txt", "dir/file2_2016-04-05.txt", "dir/file3_2016-04-05.txt", "dir/file4_2016-04-05.txt", ); foreach my $file (@files) { my $filename = basename($file); my ($name,$ymd) = split '_',$filename; if ( exists $hrefdata{$name} ){ doresults( $filename, $hrefdata{$name} ); } } sub doresults { my ($filename, $recs ) = @_; print "\n $filename = $recs\n"; }
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2016-07-02 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (20 votes). Check out past polls.