Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:39:17+00:00 2026-06-12T22:39:17+00:00

I began to mess around with the Web in Perl. I use Windows, and

  • 0

I began to mess around with the Web in Perl. I use Windows, and ActivePerl. I wrote a script, which downloads mp3 files (It’s an archive of a radio talkshow, all legal, in case you’re wondering 🙂 ) It (in theory)

  • parses a website
  • collects all links pointing to an mp3 file to an array
  • iterates through the array and downloads all files

However the script finds all the links, the array is OK, but downloads only one file. It must be a basic error, but I can’t find it. Please point out my mistake, thank you.

use strict;
use warnings;
use WWW::Mechanize;
use LWP::Simple;
use File::Basename;

my $mech = WWW::Mechanize->new( autocheck => 1 );  
$mech->get("http://something_or_other.html");

my @mp3links = $mech->find_all_links(    
    tag       => "a",
    url_regex => qr/\.mp3$/,  
);  
print "\n";                 
foreach my $link (@mp3links) {  

    my $url       = $link->url();  
    my $localfile = basename($url);  
    my $localpath = "d:\\Downloads\\$localfile";

    print "$localfile\n";   
    getstore($url, $localpath);   
}  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:39:18+00:00Added an answer on June 12, 2026 at 10:39 pm

    Oh, sorry guys. This had nothing to do with Perl. My internet connection was rather sh***y, the connection was always lost ehile downloading the first file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a large SQL driven software system which has been around since Delphi
I initially began my task by trying to use JS best practices when writing
I'm trying to create a small bit of software to mess around with drag
I began writing a simple animation class in JS, which utilizes Zepto.js animation capabilities
I began to learn about web crawlers recently and I built a sample crawler
I began reading the book Code Complete 2nd edition, but stopped reading when I
I began writing an app using declarative_authorization ( http://github.com/stffn/declarative_authorization ) but I'm now wondering
I began learning Python a few days ago, and i was wondering about a
I began studying Java Regular Expression recently and I found some really intersting task.For
Only began using Haskell a couple of weeks ago - I am attempting to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.