Rob Dixon schreef:
> Jim wrote:
>> I have some code (below) that retrieves an URL from $response-
>> content. $response->content contains an RSS a retrieved RSS file.
>>
>> How would I retrieve all the URLs in $response->content instead of
>> just the first one?
>>
>> if($response->content =~ m/http:(.*?).mp3"/)
>> {
>> $url = "http:" . $1 . ".mp3";
>> }
>
> my @files = $text =~ /http:(.*?).mp3"/g;
>
> will do what you describe, but why not capture the entire URL instead
> of capturing just part of it and replacing the missing pieces:
>
> my @files = $text =~ m#(http://.*?.mp3)"#g;
Missing is escaping of the dot.
This would lead to mismatching "http://my-mp3.mp3".
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/