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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



wyndcrosser
Novice

Nov 4, 2012, 12:07 PM


Views: 3251
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="http://www.holycow.org/%myfiles/ManDept/p1.html">Program
1 - sequential statement</a><br>
<a href="http://www.holycow.org/%myfiles/MarketingDept/p1.html">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 http://www.whatever.co.uk.index.html, 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