/[webpac]/trunk/parse_format.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/parse_format.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 42 by dpavlin, Sat Mar 15 21:33:36 2003 UTC revision 43 by dpavlin, Sat Mar 22 22:43:05 2003 UTC
# Line 6  Line 6 
6  use isis_sf;  use isis_sf;
7    
8  sub parse_format {  sub parse_format {
9          my $format = shift;          my $format = shift || die "parse_format must be called with format!";
10          my $row = shift;          my $row = shift || die "parse_format must be called with row!";
11          my $i = shift || 0;     # isis repeatable number          my $i = shift || 0;     # isis repeatable number
12          my $codepage = shift || die;          my $codepage = shift || die "parse_format must be called with codepage!";
13    
14          my $out;          my $out;
15          my $out_swish;          my $out_swish;
# Line 27  sub parse_format { Line 27  sub parse_format {
27                  if ($format =~ s/^(\d\d\d)(\w?)//) {                  if ($format =~ s/^(\d\d\d)(\w?)//) {
28                          my $isis_tmp = isis_sf($row,$1,$2,$i);                          my $isis_tmp = isis_sf($row,$1,$2,$i);
29                          if ($isis_tmp) {                          if ($isis_tmp) {
30                                  $isis_tmp = $codepage->convert($isis_tmp) if ($codepage);                                  eval {
31                                            $isis_tmp = $codepage->convert($isis_tmp) if ($codepage);
32                                    };
33                                    if ($@) {
34                                            print STDERR "FATAL: something bad happend while trying to convert '$isis_tmp' [mfn: ",$row->{mfn},"]\n"
35                                    }
36                                  $display .= $prefix . $isis_tmp;                                  $display .= $prefix . $isis_tmp;
37                                  $swish .= $isis_tmp." ";                                  $swish .= $isis_tmp." ";
38  #print STDERR " == $isis_tmp";  #print STDERR " == $isis_tmp";
# Line 39  sub parse_format { Line 44  sub parse_format {
44                  } elsif ($format =~ s/^(1[01])//) {                  } elsif ($format =~ s/^(1[01])//) {
45                          my $isis_tmp = isis_sf($row,$1,undef,$i);                          my $isis_tmp = isis_sf($row,$1,undef,$i);
46                          if ($isis_tmp) {                          if ($isis_tmp) {
47                                  $isis_tmp = $codepage->convert($isis_tmp) if ($codepage);                                  eval {
48                                            $isis_tmp = $codepage->convert($isis_tmp) if ($codepage);
49                                    };
50                                    if ($@) {
51                                            print STDERR "FATAL: something bad happend while trying to convert '$isis_tmp' [mfn: ",$row->{mfn},"]\n"
52                                    }
53                                  $display .= $prefix . $isis_tmp;                                  $display .= $prefix . $isis_tmp;
54                                  $swish .= $isis_tmp." ";                                  $swish .= $isis_tmp." ";
55                          }                          }

Legend:
Removed from v.42  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.26