-----------------------------------------
답변자가 기본적으로 참고할 내용입니다.
- 배포판(옵션) : cent os 5.5
- 커널버전(옵션)
:
- 데몬버전(예:apache
1.3.27) :
- 데몬설치유형(RPM/컴파일/기타)
:
-----------------------------------------
안녕하세요 다름이아니오라
perl의 \\\:Mechanize 의 기능을 쓰기 위해
cpan ->
install \\\::Mechanize 를 입력하여 모든 옵션을 기본값으로 주고
설치했습니다
perl 의 내용중
use strict;
use warnings;
use WWW::Mechanize;
my $id = 'your_naver_id';
my $passwd = 'your_naver_password';
my $reply = 'Check! :)';
chomp($reply);
my $url = 'http://nid.naver.com/nidlogin.login';
my $mech = WWW::Mechanize->new();
$mech->get($url);
my $res = $mech->submit_form(
form_name => 'frmNIDLogin',
fields => {
id => $id,
pw => $passwd
},
);
my $base_url = 'http://cafe.naver.com/AttendanceView.nhn';
my @check_urls = (
"$base_url?search.clubid=18062050&search.menuid=6", #
"$base_url?search.clubid=10586415&search.menuid=108", #
);
for my $check_url (@check_urls){
$mech->get($check_url);
$mech->field('content', $reply);
$mech->submit();
}
이렇게 짜고.
perl test.pl 로 실행하면
[root@localhost ~]# perl test.pl
Can't locate WWW/Mechanize.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at test.pl line
3.
BEGIN failed--compilation aborted at test.pl line 3.
cpan 에 다시 들어가
cpan> install \\\::Mechanize
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Tue, 05 Jul 2011 13:42:38 GMT
Warning: Cannot install \::Mechanize, don't know what it is.
Try the command
i /\::Mechanize/
to find objects with matching identifiers.
입력하면 이렇게 뜨는데 \::Mechanize로 바꺼도 안됩니다
오류가 나는데 어떤 문제인지 모르겠습니다..
조언좀 부탁드립니다~
|