CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate: Re: [Laurent_R] Obtaining urls from source code: Edit Log


Nov 4, 2012, 12:07 PM

Views: 4596
Re: [Laurent_R] Obtaining urls from source code

I can't give the exact code, as it's on our intranet site.

for example....

<a href="">Program
1 - sequential statement</a><br>
<a href="">Program

I've got the code to return any line starting with a <href="http://...

My question
-How to add those lines to an array (this would be the best method, right? My boss said he'd like it that way if possible)
I've been able to do a foreach loop and add the data, but I'd like to hear your opinion.
-After your regular expressions finds the lines with urls, how to you get it to just print out, etc. without all those added details. My issue is that I want to be able to copy it into a word/excel doc and divide them up for my Visio layout.

Thanks guys

This is just a very basic attempt. I'm still working on it. I've got work around the house to complete as well.

while($line =<STDIN>)
if($line =~ /<a href= "http:\/\/(.+)"/)
print "$line\n";
Perl Newbie - 7 months of PERL basics.

(This post was edited by wyndcrosser on Nov 4, 2012, 12:09 PM)

Edit Log:
Post edited by wyndcrosser (Novice) on Nov 4, 2012, 12:09 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives