in reply to File Search
#1 => File::Find is the module for searching a directory tree. Have a look at the POD to find out more.use File::Find; find(\&wanted, './'); sub wanted { return unless /\.out$/; open F, '<', $_ or return; while (defined (my $line = <F>)) { print "ACTION!" if $line =~ /error/; } close F; }
#2 => If the files are big, you may want to think about optimizing, but for small files above is enough.
#3 => There are multiple modules on CPAN to do this cleanly. Search for sendmal or smtp and choose what fits your needs.
#4 => That's hard. You may want to look for a module like ACME::NOP or CORE::return, but I'm really unsure if they do enough nothing... ;-))
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File Search
by mikevanhoff (Acolyte) on Oct 23, 2003 at 16:48 UTC | |
by Beechbone (Friar) on Oct 27, 2003 at 13:18 UTC |