3 번째 수정본
Perl의 문자열 처리 관련
1. index
스트링 내에서 최초로 나타나는 서브스트링의 위치
    my $stuff  = "Howdy world!";
    my $where1 = index($stuff, "w");               
    my $where2 = index($stuff, "w", $where1 + 1);  
    my $where3 = index($stuff, "w", $where2 + 1);  
2. rindex
스트링 내에서 최후로 나타나는 서브스트링의 위치
    my $fred = "Yabba dabba doo!";
    my $where1 = rindex($fred, "abba");  
    my $where2 = rindex($fred, "abba", $where1 - 1);  
    my $where3 = rindex($fred, "abba", $where2 - 1);  
3. substr
특정 위치의 서브스트링 추출
    $part = substr($string, $initial_position, $length);
    my $mineral = substr("Fred J. Flintstone", 8, 5);  
    my $rock = substr "Fred J. Flintstone", 13, 1000;  
    my $pebble = substr "Fred J. Flintstone", 13;  
스트링이 lvalue로 주어질 경우는 치환도 가능
    my $string = "Hello, world!";
    substr($string, 0, 5) = "Goodbye";  
    substr($string, -20) =~ s/fred/barney/g;
    my $previous_value = substr($string, 0, 5, "Goodbye");  
4. sprintf
sprintf FORMAT, LIST
컴퓨터분류
 
<trackbackreceived>