File: glob.p

package info (click to toggle)
ispell-czech 20040229-5.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 3,588 kB
  • ctags: 5
  • sloc: perl: 703; makefile: 76; sh: 43
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
while (<>) {
  s/\n$//;
  s/\|//g;
  while (s/^[-\s]*([^- ]+)[-\s]*//) {
    $word=$1;
    if ($word=~/^([^{]*){([^{}]+)}(.*)$/) {
      $start=$1;
      $list=$2;
      $end=$3;
      foreach $elem (split(/,/, $list)) {
        print "$start$elem$end\n";
      }
    } else {
      $word=~s/[{}\.]//g;
      print "$word\n";
    }
  }
}