if ($what =~ /^!([a-z]+)\s?(.*?)?$/ ){
my ($command,$option) = ($1,$2);
if ($command eq 'ftp'){
my ($IP,$file) = split /\s+/, $option;
$irc->yield( privmsg => $channel => "IP :".$IP. " 파일명 : ".$file );
my $ftp = Net::FTP->new($IP); #객체생성
$ftp->login("anonymous",""); #id와 비밀번호 설정
$ftp->cwd("/"); #FTP 서버의 경로 설정
$irc->yield( privmsg => $channel => $nick . " 접속성공! " );
$ftp->get($file); #파일 다운로드
$ftp->quit; #종료
#다운받은 파일 출력
if($file=~ m!.+\.txt!) {#다운받은 파일이 .txt 파일일때 출력
open(FH ,$file)or die "Can not download file";
while(<FH>){
next if($_ eq "\n");
$irc->yield( privmsg => $channel => $_);
}
}else{
$irc->yield( privmsg => $channel => cwd().$file." 에 파일이 저장되었습니다");
}
}
}