孤独的猫

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2012年9月28日

摘要: #!/usr/bin/perl -wuse File::Temp qw(tempdir);use File::Spec::Functions;use LWP::Simple qw(getstore);my ($temp_dir)=tempdir(CLEARUP => 1);my %searches = ( google =>'http://www.google.com/#h1=en&q=perl', yahoo => 'http://search.yahoo.com/search?p=perl', microsoft =>  阅读全文
posted @ 2012-09-28 22:11 孤独的猫 阅读(315) 评论(0) 推荐(0)

摘要: #!/usr/bin/perl -wuse 5.010;open my ($points),'<','points.txt' or die "couldn't read points data: $!\n";while (<$points>) { next if /^\s*#.*$/; #跳过注释 push @xyz,[split];}foreach my $pt (@xyz) { print "point ",$i++,": x=$pt->[0],y=$pt->[1], & 阅读全文
posted @ 2012-09-28 22:00 孤独的猫 阅读(317) 评论(0) 推荐(0)