Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'web client programming with perl-chapter 6: example lwp programs-p1', công nghệ thông tin, quản trị web phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 6 Example LWP Programs-Pl This chapter presents LWP programs that are more robust and feature-rich than the examples shown in previous chapters. While Chapter 5 The LWP Library focused on teaching LWP and explained how LWP objects fit together this chapter shows you some sample LWP programs with more user-friendly options and features. We present three broad categories of web client programs Simple clients--programs that perform actions for users in real time usually with a finite list of URLs to act upon. In this section we present LWP versions of the hcat and hgrepurl programs that were presented in Chapter 4 The Socket Library. Periodic clients--robots that perform a request repeatedly with some delay between each request. Periodic clients typically request the same resource over and over or a different resource in a predictable manner. For example a client may request 0100.gif at 1 a.m. 0200.gif at 2 a.m etc. A periodic client might check some data and perform action when a condition is met. In this section we present a program that periodically checks the status of a Federal Express document. Recursive clients--robots that follow hyperlinks or other references on an HTML page. In this section we present a program that looks for bad links in a web site. The boundaries between these categories are not set in stone. It is possible to write a periodic client that also happens to be a recursive client. Or a simple client might become periodic if the document indicates that the page should be refreshed every 15 minutes. We re not trying to classify all programs into one category or another these categories are given as a way to identify distinct behaviors that a client may exhibit. The examples in this chapter all use a simple command-line interface. In Chapter 7 Graphical Examples with Perl Tk we have some additional examples with a graphical interface using the Tk extension to Perl. Simple Clients Simple clients are programs that perform actions for users