At 23:20 +0200 2002.07.31, Multi-Graphics wrote:
>$URL = "http://www.eelco.com";;
>
>use LWP::Simple;
>$string = get ($URL);
>
>if ($string =~ s/<META NAME="keywords" CONTENT=" (.+) ".*?>/$1/ig)
>{
>$keywords = $1;
>}

1.  That is not the same regex you posted to the list in your last message.
You have spaces around (.+), and you left out the /s modifier.

2.  The data at that URL does not have the same input text.  You had a
newline after 'CONTENT="', and the data at that URL has a newline before
'CONTENT'.  Your regex specifies a single space.  That won't work.

3.  You should also transform the data to local newline.

        $URL = "http://www.eelco.com";;
        use LWP::Simple;
        ($string = get ($URL)) =~ s/\015?\012/\n/g;

        $string =~ /<META NAME="keywords"\s+CONTENT="(.+?)".*?>/is;
        print $1;

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to