파일 삭제


if ( -e $output_file ) {
  unlink $output_file or die "cannot remove output file: $!";
}


파일 열기 , 닫기

open(INPUT, $keywords_file) or die "cannot open input file: $!";
close(INPUT);

파일 읽기
while ( <INPUT> ) {
  chomp; $total++;
  my ($unique_id, $named_entity, $clues) = split(/\t/);
 
  #next unless exists $top_persons->{$named_entity};
  $valid++;
  $persons{$named_entity} = [] unless exists $persons{$named_entity};
  push @{$persons{$named_entity}}, { id=>$unique_id, clues=>$clues };
}


'프로그램밍언어 > PERL' 카테고리의 다른 글

PERL 기본함수 q, qq qw  (0) 2014.06.20
PERL MAP 사용법  (0) 2014.06.20
PERL SUB 모듈에서 파라미터 받기  (0) 2014.06.20
PERL 옵션 설정  (0) 2014.06.20
PERL 변수 선언 및 특이 표현  (0) 2014.06.20
Posted by 고요한하늘
,