in reply to Re^2: Tutorial on File::Find even more basic than "Beginners Guide"
in thread Tutorial on File::Find even more basic than "Beginners Guide"
The rest of File::Find is just "specifics" that you don't need for the problem you're trying to solve.use File::Find; use strict; sub process_file { return unless -f _; # skip processing unless $_ is really a file (no +t a dir) # some code that # does stuff with $_ (contains the "current file") } # call &process_file recursively for each file in /some/directory find \&process_file, "/some/directory";
update: Try using HTML::LinkExtor - something like
use HTML::LinkExtor; my $p = HTML::LinkExtor->new(); sub process_file { return unless /\.html?$/i; # skip unless *.htm / *.html file return unless -f _; # skip processing unless $_ is really a file (no +t a dir) $p->parse_file($_); print $p->links; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tutorial on File::Find even more basic than "Beginners Guide"
by ww (Archbishop) on Jan 20, 2005 at 23:35 UTC | |
by Joost (Canon) on Jan 20, 2005 at 23:39 UTC |