use Some::Packagewill tell Perl to search for module Package in Some/Package.pm
but
@ISA = ("Some::Package")will not direct Perl correctly to the tree Some/Package.pm
why???? and how to tell Perl that we WANT Some/Package.pm, not Some::Package ???
This blog? Such a mess! Take it easy; however, 'cos we all come from a mess! ^_^
use Some::Package@ISA = ("Some::Package")use Some::Package;package Some::Package;package Package;

get từ module LWP::Simple.use LWP::Simple$content = get($url)get trong LWP::SImple trả về undef nếu có lỗi, nên ta có thể kiểm tra lỗi như sau:use LWP::Simple;unless (defined ($content = get $url) ) { die "could not get $url\n";}new được dùng để tạo một request thực. Tên của trạm trình duyệt ảo được đặt là "Schimozilla/v9.14 Platinum" để webmaster thấy ganh tị khi họ kiểm tra file log. :))#!usr/bin/perl# titlebytes - tim tieu de va kich thuoc cua tai lieuuse warnings;
use LWP:::UserAgent;use HTTP::Request;use HTTP::Response;use URI::Heuristic;
my $raw_url = shift or die "usage: $0 url\n";my $url = URI::Heuristic::uf_urlstr($raw_url);$ = 1; # flush dòng kế tiếpprintf "%s =>\n\t", $url;my $ua = LWP::UserAgent->new();$ua->agent("Schmozilla/v9.14 Platinum"); # đợi đi, thế nào cũng cómy $req = HTTP::Request->new(GET => $url);$req->referer("http://wizard.yellowbrick.oz"); # tung hoả mù cho các chương trình phân tích log
my $response = $ua->request($req);if ( $response->is_error() ) { printf " %\n", $response->status_line;} else {my $count;my $byte;my $content = $response->content();$bytes = length $content;$count = ($content =~ tr/\n/\n/);printf "%s (%d lines,%d bytes)\n", $response->title(), $count, $byte;}
% titlebytes http://www.tpj.com/http://www.tpj.com/ => The Perl Journal (109 lines, 4530 bytes)
lwpcook đi kèm với LWP; tài liệu của các module LWP::UserAgent, HTTP::Request, HTTP::REsponse, URI::Heuristic, công thức 20.2.
| Module | Mục đích |
| LWP::UserAgent | www user agent class |
| LWP::RobotUA | Phát triển các ứng dụng robot |
| LWP::Protocol | giao tiếp với các kiểu giao thức khác nhau |
| LWP::Authen::Basic | Xử lý các trả lời 401 và 407 |
| LWP::MEdiaTypes | cấu hình các kiểu MIME (text/html, ...) |
| LWP::Debug | debug logging module |
| LWP::Simple | giao tiếp với các giao thức đơn giản cho các hàm chung |
| HTTP::Headers | các dạng header MIME/RFC822 |
| HTTP::Message | message dạng HTTP |
| HTTP::Request | HTTP request |
| HTTP::Response | HTTP response |
| HTTP::Deamon | 1 lớp HTTP server |
| HTTP::Status | mã status HTTP |
| HTTP::Date | lấy ngày từ định dạng ngày http |
| HTTP::Negotiate | HTTP content negotiation calculation |
| HTTP::RobotRules | đọc các file robot.txt |
| File::Listing | đọc danh sách liệt kê thư mục |