Hello All.

I can see why people hate this module but I can't seem to let go.
I point this script at a deep dir structure that has java .properties 
files sprinkled throughout it. Right now when I have my regex "hard coded"
in the file, (.properties$) the search works fine. I need to be able to use
the variable $searchstring at the command line. Is this even possible? If
not, is there a way to exclude directories from being returned?


Thanks.

use strict;
use warnings;
use File::Find;
use Getopt::Std;
use vars qw/ %opt /;
use diagnostics;

my $args = 't:s:a:';
getopts( "$args", \%opt );
my $targetdir = $opt{t};
my $searchstring = $opt{s};
my $append = $opt{a};

find(\&mod, $targetdir);

        sub mod {
                return unless ($_ =~ /\.properties$/);
                print "$_\n"
                }

-- 
Monkeys are superior to men in this:
when a monkey looks into a mirror, he sees a monkey.

-- Malcolm De Chazal

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to