我想在这个perl脚本中使用代理,但我不确定如何使用代理.
#!/usr/bin/perl use IO::Socket; $remote = IO::Socket::INET->new( Proto => "tcp",PeerAddr => "localhost",PeerPort => "8080",) or die "cannot connect"; print $remote "GET / HTTP/1.0\n\n"; while ( <$remote> ) { print }
解决方法
使用LWP :: UserAgent模块,内置
proxy support.