my ($forecast, $t); use Net::Telnet (); $t = new Net::Telnet; $t->open("rainmaker.wunderground.com"); ## Wait for first prompt and "hit return". $t->waitfor('/continue:.*$/'); $t->print(""); ## Wait for second prompt and respond with city code. $t->waitfor('/city code.*$/'); $t->print("BRD"); ## Read and print the first page of forecast. ($forecast) = $t->waitfor('/[ \t]+press return to continue/i'); print $forecast; exit;