http://qs321.pair.com?node_id=11116756


in reply to Re^3: saveResources_future and tab in WWW::Mechanize::Chrome
in thread saveResources_future and tab in WWW::Mechanize::Chrome

Thank you! I think it was here:
$names{ $resource->{url} } ||= File::Spec->catfile( $target_dir, $names{ $resource->{url} });
Best regards
1nelly1

Replies are listed 'Best First'.
Re^5: saveResources_future and tab in WWW::Mechanize::Chrome
by Corion (Patriarch) on May 13, 2020 at 12:38 UTC

    No, that's the part that works.

    The part that fails is in ub fetchResources_future, which doesn't respect any base directory at all currently. There, more or less the same thing has to happen:

    ... my $duplicates; my $old_target = $target; while( $filenames{ $target }) { $duplicates++; ( $target = $old_target )=~ s!\.(\w+)$!_$duplicates.$ +1!; }; - $names->{ $res->{url} } = $target; + $names->{ $res->{url} } = File::Spec->catfile( $base_dir, + $target ); };

      Ok. I see. Thank you for these insights.
      And many thanks for your quick help.
      Best regards
      1nelly1

        Sorry to bother you again. I installed the update. Now in %names only one uri and no printing at all in sub saveResources_future.
        Best regards
        1nelly1