[root@dr-mysql01 ~]# cat aa.pl
use LWP::UserAgent;
use Data::Dumper;
my $ua = LWP::UserAgent->new;
$phone=$ARGV[0];
$cc=$ARGV[1];
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
$host = "xxxxxxxx";
my $response = $ua->get($host);
my $var= Dumper($ua);
print $var;
print "\n";
my $var= Dumper($response);
print $var;
print "\n";
$ua->default_headers;
if ($response->is_success) {
print $response->decoded_content; # or whatever
}
else {
die $response->status_line;
}
[root@dr-mysql01 ~]# set -o vi
[root@dr-mysql01 ~]# perl aa.pl 180722722237 test
$VAR1 = bless( {
'max_redirect' => 7,
&
perl 对象 bless 引用
最新推荐文章于 2023-08-06 16:00:26 发布
这篇博客介绍了Perl中bless引用的概念,展示了如何使用bless将数据结构标记为特定包的对象。通过示例代码解释了Perl对象的创建过程,包括Net::Ping模块的new方法,并探讨了$self和$class变量在对象方法调用中的作用。
摘要由CSDN通过智能技术生成