in reply to Environment Variable Question

I think you're confusing environment variables with cgi variables and/or cookie values.. My short answer would be to avoid it all together and parse the links, and the easiest way to do this would be to use WWW::Mechanize, which is based on LWP so you won't need to change much in your code, but you will be able to take advantage of the find_link() and find_all_links methods. You'll be specifically interested in something like:
my @links = $res->find_all_links( url_regex => /\bvar=/ ); foreach my $link (@links){ # $link is a WWW::Mechanize::Link object next unless $link->url =~ /\bvar=([^&?]+)/; # this RE will need twe +aking warn "URL is " . $link->url; warn "Value is '$1'"; }