Help for this page

Select Code to Download


  1. or download this
    while ($s =~ /(.*?)\|(.*?)\|(.*?)\|/g) {
        print "$1\t$2\t$3\n";
    }
    
  2. or download this
    while ($s =~ /((?:.*?\|){3})/g) {
        print "$1\n";
    }
    
  3. or download this
    local $/ = "|";   # set input record separator
    
    while (<>) {
        print $_, scalar <>, scalar <>, "\n";
    }
    
  4. or download this
    local $/ = "|";
    
    ...
        print;
        print "\n" unless $. % 3;
    }