Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: What is missing from the beginning of this string?

by dasgar (Priest)
on Oct 07, 2010 at 23:00 UTC ( #864106=note: print w/replies, xml ) Need Help??


in reply to What is missing from the beginning of this string?

   I have a potentially malformed URL. It MAY be missing ... then again, it might be fine.

Honestly, I haven't the faintest clue what you're trying to do or why you think there is a problem. Here's what I'm able to gather from your post:

  1. You have some source providing your script/program with URLs.
  2. Your script/program is acting on that information.
  3. Since your code is not always doing what is expected, you believe that there's a chance you're getting invalid URLs.

Sounds to me like it's time for debugging, which for me means to start adding print statements to figure out what's happening where. For example, print out the URLs, then look to see what kind of issues there are, and then develop a plan to deal with them. Doing this might help you figure out if you're getting invalid URLs and if so, how are they invalid, which in turn helps with figuring out the regex.

The only other idea right now is to find a module that does the URL validation for you.

  • Comment on Re: What is missing from the beginning of this string?

Replies are listed 'Best First'.
Re^2: What is missing from the beginning of this string?
by japhy (Canon) on Oct 08, 2010 at 00:47 UTC
    "I haven't the faintest clue what you're trying to do"

    I am trying to correct a potentially malformed "http://" at the beginning of a URL.

    I am not in control of the URLs I am receiving. It is not for me to debug, it is simply for me to correct.


    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    Nos autem praedicamus Christum crucifixum (1 Cor. 1:23) - The Cross Reference (My Blog)
Re^2: What is missing from the beginning of this string?
by ambrus (Abbot) on Oct 09, 2010 at 09:22 UTC

    Haven't you ever copy-pasted urls with the mouse from a window to the browser title bar and find that you failed to select the h at the beginning?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://864106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2022-05-21 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (77 votes). Check out past polls.

    Notices?