|
#!/usr/bin/perl
my $url = 'http://freshair.npr.org/dayFA.cfm?todayDate=current'
use LWP::Simple;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
if($content =~ m/jazz/i) {
print "They're talking about jazz today on Fresh Air!\n";
} else {
print "Fresh Air is apparently jazzless today.\n";
}
为什么我运行后报错呢?
[root@ROOT perl]# perl getURL_test.pl
"use" not allowed in expression at getURL_test.pl line 4, at end of line
syntax error at getURL_test.pl line 4, near "use LWP::Simple"
Execution of getURL_test.pl aborted due to compilation errors.
英文又不好,请前辈们指点一下。谢了。。 |
|