in reply to Re: File Find error
in thread File Find error

I added as you requested and now dont get an error message but also I dont get any output at all. Please advise what else I need to do to get this work:
use HTML::LinkExtor; use LWP::Simple; use File::Find; sub LinkRoutine { my $name = $File::Find::name; return unless -f $name; open ( FH, $name ) or die "error $!: $name\n"; while(my $line = <FH>) { $base_url = $name; $parser = HTML::LinkExtor->new(undef, $name); $parser->parse(get($name))->eof; @links = $parser->links; foreach $linkarray (@links) { @element = @$linkarray; $elt_type = shift @element; while (@element) { ($attr_name, $attr_value) = splice(@element, 0 , 2); $seen{$attr_value}++; } } close(FH) } } find( \&LinkRoutine, "/perl/bin" ); for (sort keys %seen) { print $_, "\n"; }

Replies are listed 'Best First'.
Re: Re: Re: File Find error
by chip (Curate) on Jun 23, 2003 at 19:05 UTC
    I suspect you don't want to break your file up into individual lines before HTML parsing them. :-) To test whether that's the problem, put:

      local $/;

    before the 'while my $line' loop.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      Thanks,
      I tried that and it still gives me no output. Any other suggestions??