File: glob.p

package info (click to toggle)
ispell-czech 20040229-4.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,580 kB
  • ctags: 5
  • sloc: perl: 711; makefile: 70; sh: 43
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (8)
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";
    }
  }
}