■正拳突きのHP:(perl)インターネットにアクセス
作成日:2011/10/12
作成環境:ubuntu11 perl5
aptitude search libwwwコマンドを実行したところ、libwww-perlはインストール済み(先頭がi)のため、LWPのインストールは不要でした。
■実行結果
hoge@ubuntu:~/public_html/perl$ aptitude search libwww
~略~
p libwww-mediawiki-client-perl - simple CVS-like interface for editing MediaWiki
p libwww-myspace-perl - Perl interface to MySpace.com profile
p libwww-opensearch-perl - search OpenSearch compatible web sites
i libwww-perl - simple and consistent interface to the world-wi
p libwww-search-perl - Perl modules which provide an API to WWW search
p libwww-shorten-perl - Perl modules providing abstract interface to UR
p libwww-topica-perl - Perl module to read emails from a Topica mailin
~略~
「http://seikenzuki.bakufu.org/program/tips_perl/001hello.html」にGETでアクセスして結果のタグを検索して表示します。
■実行結果
hoge@ubuntu:~/public_html/perl$ ./www.pl
タグの数を数える
divタグの数は 1 個です。
spanタグの数は 0 個です。
pタグの数は 0 個です。
scriptタグの数は 1 個です。
inputタグの数は 0 個です。
styleタグの数は 0 個です。
htmlタグの数は 1 個です。
配列とforeachでやる
divタグの数は 1 個です。
spanタグの数は 0 個です。
pタグの数は 0 個です。
scriptタグの数は 1 個です。
inputタグの数は 0 個です。
styleタグの数は 0 個です。
htmlタグの数は 1 個です。
hoge@ubuntu:~/public_html/perl$
TOPに戻る