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 127841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:32:26+00:00 2026-05-11T05:32:26+00:00

So it seemed easy enough. Use a series of nested loops to go though

  • 0

So it seemed easy enough. Use a series of nested loops to go though a ton of URLs sorted by year/month/day and download the XML files. As this is my first script, I started with the loop; something familiar in any language. I ran it just printing the constructed URLs and it worked perfect.

I then wrote the code to download the content and save it separately, and that worked perfect as well with a sample URL on multiple test cases.

But when I combined these two bits of code, it broke, the program just got stuck and did nothing at all.

I therefore ran the debugger and as I stepped through it, it became stuck on this one line:

warnings::register::import(/usr/share/perl/5.10/warnings/register.pm:25):25:vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0; 

If I just hit r to return from the subroutine it works and continues to another point on its way back down the call stack where something similar happens over and over for some time. The stack trace:

warnings::register::import('warnings::register') called from file `/usr/lib/perl/5.10/Socket.pm' line 7 Socket::BEGIN() called from file `/usr/lib/perl/5.10/Socket.pm' line 7 eval {...} called from file `/usr/lib/perl/5.10/Socket.pm' line 7 require 'Socket.pm' called from file `/usr/lib/perl/5.10/IO/Socket.pm' line 12 IO::Socket::BEGIN() called from file `/usr/lib/perl/5.10/Socket.pm' line 7 eval {...} called from file `/usr/lib/perl/5.10/Socket.pm' line 7 require 'IO/Socket.pm' called from file `/usr/share/perl5/LWP/Simple.pm' line 158 LWP::Simple::_trivial_http_get('www.aDatabase.com', 80, '/sittings/1987/oct/20.xml') called from file `/usr/share/perl5/LWP/Simple.pm' line 136 LWP::Simple::_get('http://www.aDatabase.com/1987/oct/20.xml') called from file `xmlfetch.pl' line 28 

As you can see it is getting stuck inside this "get($url)" method, and I have no clue why? Here is my code:

#!/usr/bin/perl  use LWP::Simple;  $urlBase = 'http://www.aDatabase.com/subheading/'; $day=1; $month=1; @months=("list of months","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); $year=1987; $nullXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<nil-classes type=\"array\"/>\n";      while($year<=2006)     {     $month=1;     while($month<=12)         {         $day=1;         while($day<=31)             {             $newUrl = "$urlBase$year/$months[$month]/$day.xml";             $content = get($newUrl);             if($content ne $nullXML)                 {                 $filename = "$year-$month-$day.xml";                 open(FILE, ">$filename");                 print FILE $content;                 close(FILE);                 }             $day++;             }         $month++;         }     $year++;     } 

I am almost positive it is something tiny I just dont know, but google has not turned up anything.

EDIT: It’s official, it just hangs forever inside this get method, runs for several loops then hangs again for a while. But its still a problem. Why is this happening?

  • 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. 2026-05-11T05:32:27+00:00Added an answer on May 11, 2026 at 5:32 am

    Since http://www.adatabase.com/1987/oct/20.xml is a 404 (and isn’t something that can be generated from your program anyway (no ‘subheading’ in the path), I’m assuming that isn’t the real link you are using, which makes it hard for us to test. As a general rule, please use example.com instead of making up hostnames, that’s why it is reserved.

    You should really

    use strict; use warnings; 

    in your code – this will help highlight any scoping issues you may have (I’d be surprised if it was the case, but there is a chance that a part of the LWP code is messing around with your $urlBase or something). I think it should be enough to change the inital variable declarations (and $newUrl, $content and $filename) to put ‘my’ in front to make your code strict.

    If using strict and warnings doesn’t get you any closer to a solution, you could warn out the link you are about to use each loop so when it sticks you can try it in a browser and see what happens, or alternatively using a packet sniffer (such as Wireshark) could give you some clues.

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

Sidebar

Related Questions

This seemed like it should be easy, but I have had trouble getting it
I saw somewhere what seemed to be nested selects, one master select on the
this seemed easy... I wrote a dialog widget where I put some entries, buttons
My problem seemed easy at first but i got stuck. I have some containers
I'm stuck at something that seemed easy but became a headache pretty fast: Here
This seemed like an easy thing to do. I just wanted to pop up
This one has me puzzled. It seemed like an easy task, but the solution
This seemed to me like an easy one, but I can't seem to find
At first glance it seemed like an easy question, but I just can't figure
GenICam seemed like the best alternative, however the documentation is sparse. Thanks in advance!

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.