Home > Archive > PERL Miscellaneous > July 2006 > Search a Text File for a String, Return String to Function
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Search a Text File for a String, Return String to Function
|
|
| cl@supportreport.org 2006-07-29, 6:58 pm |
| Howdy
So while I've been able to do things similar to this in other languages
I thought I'd sharpent my Perl skills but, alas, those skills were more
dull then I thought.
What I'm trying to do is search a text file for a string "<a
href="something">" and return that something do another part of the
script. The "something" part changes at random so that one day the
first line of the file I am searching could be
"<a href="something">"
and the next day it could be
"<a href="and now for something completly different">"
So I guess what I'm saying is I want to return whatever is between the
quotes that start after the first instance of href that Perl finds in
the file.
Thoughts on how to go about this in a somewhat effeciant way?
| |
| Dr.Ruud 2006-07-29, 6:58 pm |
| cl@supportreport.org schreef:
> So while I've been able to do things similar to this in other
> languages I thought I'd sharpent my Perl skills but, alas, those
> skills were more dull then I thought.
>
> What I'm trying to do is search a text file for a string "<a
> href="something">" and return that something do another part of the
> script. The "something" part changes at random so that one day the
> first line of the file I am searching could be
>
> "<a href="something">"
>
> and the next day it could be
>
> "<a href="and now for something completly different">"
>
> So I guess what I'm saying is I want to return whatever is between the
> quotes that start after the first instance of href that Perl finds in
> the file.
>
> Thoughts on how to go about this in a somewhat effeciant way?
From all those I guess that you just want to find the value of a link in
HTML?
http://search.cpan.org/search?query...ink&mode=module
Did you read the Posting Guidelines yet?
--
Affijn, Ruud
"Gewoon is een tijger."
|
|
|
|
|