in reply to checking output for text

You need LWP::UserAgent for a full-strength version of what you're trying to do.

If your HEAD request fails, try GET, lots of sites block HEAD requests for some reason.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: checking output for text
by Anonymous Monk on Oct 09, 2002 at 04:25 UTC
    another way without making use of a module would be to define a hash or array with the values you wanted to find (I think I would use a hash)... If I noticed correctly all the lines you are intested in start with your 'key' and a colon so
    %to_find = ( 'Set-Cookie' => '1', 'Server' => '1', #etc so on and so forth ); while (<$socket>) { # split on the first colon, but leave the rest alone ($key,$rest) = split(/:/, $_, 2); print "$key: $rest\n" if ($to_find{$key}); }