2 |
use Exporter 'import'; |
use Exporter 'import'; |
3 |
@EXPORT = qw/ |
@EXPORT = qw/ |
4 |
_set_rec _set_lookup |
_set_rec _set_lookup |
5 |
|
_set_load_ds |
6 |
_get_ds _clean_ds |
_get_ds _clean_ds |
7 |
_debug |
_debug |
8 |
|
_pack_subfields_hash |
9 |
|
|
10 |
tag search display |
tag search display |
11 |
marc marc_indicators marc_repeatable_subfield |
marc marc_indicators marc_repeatable_subfield |
12 |
marc_compose marc_leader |
marc_compose marc_leader |
13 |
marc_duplicate marc_remove |
marc_duplicate marc_remove |
14 |
|
marc_original_order |
15 |
|
|
16 |
rec1 rec2 rec |
rec1 rec2 rec |
17 |
regex prefix suffix surround |
regex prefix suffix surround |
18 |
first lookup join_with |
first lookup join_with |
19 |
|
save_into_lookup |
20 |
|
|
21 |
split_rec_on |
split_rec_on |
22 |
/; |
/; |
26 |
|
|
27 |
#use base qw/WebPAC::Common/; |
#use base qw/WebPAC::Common/; |
28 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
|
use Encode qw/from_to/; |
|
29 |
use Storable qw/dclone/; |
use Storable qw/dclone/; |
30 |
|
use Carp qw/confess/; |
31 |
|
|
32 |
# debugging warn(s) |
# debugging warn(s) |
33 |
my $debug = 0; |
my $debug = 0; |
39 |
|
|
40 |
=head1 VERSION |
=head1 VERSION |
41 |
|
|
42 |
Version 0.14 |
Version 0.21 |
43 |
|
|
44 |
=cut |
=cut |
45 |
|
|
46 |
our $VERSION = '0.14'; |
our $VERSION = '0.21'; |
47 |
|
|
48 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
49 |
|
|
69 |
Return data structure |
Return data structure |
70 |
|
|
71 |
my $ds = WebPAC::Normalize::data_structure( |
my $ds = WebPAC::Normalize::data_structure( |
72 |
lookup => $lookup->lookup_hash, |
lookup => $lookup_hash, |
73 |
row => $row, |
row => $row, |
74 |
rules => $normalize_pl_config, |
rules => $normalize_pl_config, |
75 |
marc_encoding => 'utf-8', |
marc_encoding => 'utf-8', |
76 |
config => $config, |
config => $config, |
77 |
|
load_ds_coderef => sub { |
78 |
|
my ($database,$input,$mfn) = shift; |
79 |
|
$store->load_ds( database => $database, input => $input, id => $mfn ); |
80 |
|
}, |
81 |
); |
); |
82 |
|
|
83 |
Options C<lookup>, C<row>, C<rules> and C<log> are mandatory while all |
Options C<row>, C<rules> and C<log> are mandatory while all |
84 |
other are optional. |
other are optional. |
85 |
|
|
86 |
|
C<load_ds_coderef> is closure only used when executing lookups, so they will |
87 |
|
die if it's not defined. |
88 |
|
|
89 |
This function will B<die> if normalizastion can't be evaled. |
This function will B<die> if normalizastion can't be evaled. |
90 |
|
|
91 |
Since this function isn't exported you have to call it with |
Since this function isn't exported you have to call it with |
93 |
|
|
94 |
=cut |
=cut |
95 |
|
|
96 |
|
my $load_ds_coderef; |
97 |
|
|
98 |
sub data_structure { |
sub data_structure { |
99 |
my $arg = {@_}; |
my $arg = {@_}; |
100 |
|
|
102 |
die "need normalisation argument" unless ($arg->{rules}); |
die "need normalisation argument" unless ($arg->{rules}); |
103 |
|
|
104 |
no strict 'subs'; |
no strict 'subs'; |
105 |
_set_lookup( $arg->{lookup} ); |
_set_lookup( $arg->{lookup} ) if defined($arg->{lookup}); |
106 |
_set_rec( $arg->{row} ); |
_set_rec( $arg->{row} ); |
107 |
_set_config( $arg->{config} ); |
_set_config( $arg->{config} ) if defined($arg->{config}); |
108 |
_clean_ds( %{ $arg } ); |
_clean_ds( %{ $arg } ); |
109 |
|
$load_ds_coderef = $arg->{load_ds_coderef}; |
110 |
|
|
111 |
eval "$arg->{rules}"; |
eval "$arg->{rules}"; |
112 |
die "error evaling $arg->{rules}: $@\n" if ($@); |
die "error evaling $arg->{rules}: $@\n" if ($@); |
113 |
|
|
200 |
$lookup = shift; |
$lookup = shift; |
201 |
} |
} |
202 |
|
|
203 |
|
=head2 _get_lookup |
204 |
|
|
205 |
|
Get current lookup hash |
206 |
|
|
207 |
|
my $lookup = _get_lookup(); |
208 |
|
|
209 |
|
=cut |
210 |
|
|
211 |
|
sub _get_lookup { |
212 |
|
return $lookup; |
213 |
|
} |
214 |
|
|
215 |
|
=head2 _set_load_ds |
216 |
|
|
217 |
|
Setup code reference which will return L<data_structure> from |
218 |
|
L<WebPAC::Store> |
219 |
|
|
220 |
|
_set_load_ds(sub { |
221 |
|
my ($database,$input,$mfn) = @_; |
222 |
|
$store->load_ds( database => $database, input => $input, id => $mfn ); |
223 |
|
}); |
224 |
|
|
225 |
|
=cut |
226 |
|
|
227 |
|
sub _set_load_ds { |
228 |
|
my $coderef = shift; |
229 |
|
confess "argument isn't CODE" unless ref($coderef) eq 'CODE'; |
230 |
|
|
231 |
|
$load_ds_coderef = $coderef; |
232 |
|
} |
233 |
|
|
234 |
=head2 _get_marc_fields |
=head2 _get_marc_fields |
235 |
|
|
236 |
Get all fields defined by calls to C<marc> |
Get all fields defined by calls to C<marc> |
514 |
foreach (@_) { |
foreach (@_) { |
515 |
my $v = $_; # make var read-write for Encode |
my $v = $_; # make var read-write for Encode |
516 |
next unless (defined($v) && $v !~ /^\s*$/); |
next unless (defined($v) && $v !~ /^\s*$/); |
|
from_to($v, 'iso-8859-2', $marc_encoding) if ($marc_encoding); |
|
517 |
my ($i1,$i2) = defined($marc_indicators->{$f}) ? @{ $marc_indicators->{$f} } : (' ',' '); |
my ($i1,$i2) = defined($marc_indicators->{$f}) ? @{ $marc_indicators->{$f} } : (' ',' '); |
518 |
if (defined $sf) { |
if (defined $sf) { |
519 |
push @{ $marc_record->[ $marc_record_offset ] }, [ $f, $i1, $i2, $sf => $v ]; |
push @{ $marc_record->[ $marc_record_offset ] }, [ $f, $i1, $i2, $sf => $v ]; |
570 |
'c', rec('200','c') |
'c', rec('200','c') |
571 |
); |
); |
572 |
|
|
573 |
|
If you specify C<+> for subfield, value will be appended |
574 |
|
to previous defined subfield. |
575 |
|
|
576 |
=cut |
=cut |
577 |
|
|
578 |
sub marc_compose { |
sub marc_compose { |
584 |
|
|
585 |
warn "### marc_compose input subfields = ", dump(@_),$/ if ($debug > 2); |
warn "### marc_compose input subfields = ", dump(@_),$/ if ($debug > 2); |
586 |
|
|
587 |
|
if ($#_ % 2 != 1) { |
588 |
|
die "ERROR: marc_compose",dump($f,@_)," not valid (must be even).\nDo you need to add first() or join() around some argument?\n"; |
589 |
|
} |
590 |
|
|
591 |
while (@_) { |
while (@_) { |
592 |
my $sf = shift or die "marc_compose $f needs subfield"; |
my $sf = shift; |
593 |
my $v = shift; |
my $v = shift; |
594 |
|
|
595 |
next unless (defined($v) && $v !~ /^\s*$/); |
next unless (defined($v) && $v !~ /^\s*$/); |
|
from_to($v, 'iso-8859-2', $marc_encoding) if ($marc_encoding); |
|
|
push @$m, ( $sf, $v ); |
|
596 |
warn "## ++ marc_compose($f,$sf,$v) ", dump( $m ),$/ if ($debug > 1); |
warn "## ++ marc_compose($f,$sf,$v) ", dump( $m ),$/ if ($debug > 1); |
597 |
|
if ($sf ne '+') { |
598 |
|
push @$m, ( $sf, $v ); |
599 |
|
} else { |
600 |
|
$m->[ $#$m ] .= $v; |
601 |
|
} |
602 |
} |
} |
603 |
|
|
604 |
warn "## marc_compose current marc = ", dump( $m ),$/ if ($debug > 1); |
warn "## marc_compose current marc = ", dump( $m ),$/ if ($debug > 1); |
689 |
warn "## full marc_record = ", dump( @{ $marc_record }), $/ if ($debug > 1); |
warn "## full marc_record = ", dump( @{ $marc_record }), $/ if ($debug > 1); |
690 |
} |
} |
691 |
|
|
692 |
|
=head2 marc_original_order |
693 |
|
|
694 |
|
Copy all subfields preserving original order to marc field. |
695 |
|
|
696 |
|
marc_original_order( marc_field_number, original_input_field_number ); |
697 |
|
|
698 |
|
Please note that field numbers are consistent with other commands (marc |
699 |
|
field number first), but somewhat counter-intuitive (destination and then |
700 |
|
source). |
701 |
|
|
702 |
|
You might want to use this command if you are just renaming subfields or |
703 |
|
using pre-processing modify_record in C<config.yml> and don't need any |
704 |
|
post-processing or want to preserve order of original subfields. |
705 |
|
|
706 |
|
|
707 |
|
=cut |
708 |
|
|
709 |
|
sub marc_original_order { |
710 |
|
|
711 |
|
my ($to, $from) = @_; |
712 |
|
die "marc_original_order needs from and to fields\n" unless ($from && $to); |
713 |
|
|
714 |
|
return unless defined($rec->{$from}); |
715 |
|
|
716 |
|
my $r = $rec->{$from}; |
717 |
|
die "record field $from isn't array\n" unless (ref($r) eq 'ARRAY'); |
718 |
|
|
719 |
|
my ($i1,$i2) = defined($marc_indicators->{$to}) ? @{ $marc_indicators->{$to} } : (' ',' '); |
720 |
|
warn "## marc_original_order($to,$from) source = ", dump( $r ),$/ if ($debug > 1); |
721 |
|
|
722 |
|
foreach my $d (@$r) { |
723 |
|
|
724 |
|
if (! defined($d->{subfields}) && ref($d->{subfields}) ne 'ARRAY') { |
725 |
|
warn "# marc_original_order($to,$from): field $from doesn't have subfields specification\n"; |
726 |
|
next; |
727 |
|
} |
728 |
|
|
729 |
|
my @sfs = @{ $d->{subfields} }; |
730 |
|
|
731 |
|
die "field $from doesn't have even number of subfields specifications\n" unless($#sfs % 2 == 1); |
732 |
|
|
733 |
|
warn "#--> d: ",dump($d), "\n#--> sfs: ",dump(@sfs),$/ if ($debug > 2); |
734 |
|
|
735 |
|
my $m = [ $to, $i1, $i2 ]; |
736 |
|
|
737 |
|
while (my $sf = shift @sfs) { |
738 |
|
|
739 |
|
warn "#--> sf: ",dump($sf), $/ if ($debug > 2); |
740 |
|
my $offset = shift @sfs; |
741 |
|
die "corrupted sufields specification for field $from\n" unless defined($offset); |
742 |
|
|
743 |
|
my $v; |
744 |
|
if (ref($d->{$sf}) eq 'ARRAY') { |
745 |
|
$v = $d->{$sf}->[$offset] if (defined($d->{$sf}->[$offset])); |
746 |
|
} elsif ($offset == 0) { |
747 |
|
$v = $d->{$sf}; |
748 |
|
} else { |
749 |
|
die "field $from subfield '$sf' need occurence $offset which doesn't exist", dump($d->{$sf}); |
750 |
|
} |
751 |
|
push @$m, ( $sf, $v ) if (defined($v)); |
752 |
|
} |
753 |
|
|
754 |
|
if ($#{$m} > 2) { |
755 |
|
push @{ $marc_record->[ $marc_record_offset ] }, $m; |
756 |
|
} |
757 |
|
} |
758 |
|
|
759 |
|
warn "## marc_record = ", dump( $marc_record ),$/ if ($debug > 1); |
760 |
|
} |
761 |
|
|
762 |
|
|
763 |
=head1 Functions to extract data from input |
=head1 Functions to extract data from input |
764 |
|
|
765 |
This function should be used inside functions to create C<data_structure> described |
This function should be used inside functions to create C<data_structure> described |
766 |
above. |
above. |
767 |
|
|
768 |
|
=head2 _pack_subfields_hash |
769 |
|
|
770 |
|
@subfields = _pack_subfields_hash( $h ); |
771 |
|
$subfields = _pack_subfields_hash( $h, 1 ); |
772 |
|
|
773 |
|
Return each subfield value in array or pack them all together and return scalar |
774 |
|
with subfields (denoted by C<^>) and values. |
775 |
|
|
776 |
|
=cut |
777 |
|
|
778 |
|
sub _pack_subfields_hash { |
779 |
|
|
780 |
|
warn "## _pack_subfields_hash( ",dump(@_), " )\n" if ($debug > 1); |
781 |
|
|
782 |
|
my ($h,$include_subfields) = @_; |
783 |
|
|
784 |
|
if ( defined($h->{subfields}) ) { |
785 |
|
my $sfs = delete $h->{subfields} || die "no subfields?"; |
786 |
|
my @out; |
787 |
|
while (@$sfs) { |
788 |
|
my $sf = shift @$sfs; |
789 |
|
push @out, '^' . $sf if ($include_subfields); |
790 |
|
my $o = shift @$sfs; |
791 |
|
if ($o == 0 && ref( $h->{$sf} ) ne 'ARRAY' ) { |
792 |
|
# single element subfields are not arrays |
793 |
|
#warn "====> $sf $o / $#$sfs ", dump( $sfs, $h->{$sf} ), "\n"; |
794 |
|
|
795 |
|
push @out, $h->{$sf}; |
796 |
|
} else { |
797 |
|
#warn "====> $sf $o / $#$sfs ", dump( $sfs, $h->{$sf} ), "\n"; |
798 |
|
push @out, $h->{$sf}->[$o]; |
799 |
|
} |
800 |
|
} |
801 |
|
if ($include_subfields) { |
802 |
|
return join('', @out); |
803 |
|
} else { |
804 |
|
return @out; |
805 |
|
} |
806 |
|
} else { |
807 |
|
if ($include_subfields) { |
808 |
|
my $out = ''; |
809 |
|
foreach my $sf (sort keys %$h) { |
810 |
|
if (ref($h->{$sf}) eq 'ARRAY') { |
811 |
|
$out .= '^' . $sf . join('^' . $sf, @{ $h->{$sf} }); |
812 |
|
} else { |
813 |
|
$out .= '^' . $sf . $h->{$sf}; |
814 |
|
} |
815 |
|
} |
816 |
|
return $out; |
817 |
|
} else { |
818 |
|
# FIXME this should probably be in alphabetical order instead of hash order |
819 |
|
values %{$h}; |
820 |
|
} |
821 |
|
} |
822 |
|
} |
823 |
|
|
824 |
=head2 rec1 |
=head2 rec1 |
825 |
|
|
826 |
Return all values in some field |
Return all values in some field |
837 |
return unless (defined($rec) && defined($rec->{$f})); |
return unless (defined($rec) && defined($rec->{$f})); |
838 |
warn "rec1($f) = ", dump( $rec->{$f} ), $/ if ($debug > 1); |
warn "rec1($f) = ", dump( $rec->{$f} ), $/ if ($debug > 1); |
839 |
if (ref($rec->{$f}) eq 'ARRAY') { |
if (ref($rec->{$f}) eq 'ARRAY') { |
840 |
return map { |
my @out; |
841 |
if (ref($_) eq 'HASH') { |
foreach my $h ( @{ $rec->{$f} } ) { |
842 |
values %{$_}; |
if (ref($h) eq 'HASH') { |
843 |
|
push @out, ( _pack_subfields_hash( $h ) ); |
844 |
} else { |
} else { |
845 |
$_; |
push @out, $h; |
846 |
} |
} |
847 |
} @{ $rec->{$f} }; |
} |
848 |
|
return @out; |
849 |
} elsif( defined($rec->{$f}) ) { |
} elsif( defined($rec->{$f}) ) { |
850 |
return $rec->{$f}; |
return $rec->{$f}; |
851 |
} |
} |
973 |
|
|
974 |
Consult lookup hashes for some value |
Consult lookup hashes for some value |
975 |
|
|
976 |
@v = lookup( $v ); |
@v = lookup( |
977 |
@v = lookup( @v ); |
sub { |
978 |
|
'ffkk/peri/mfn'.rec('000') |
979 |
|
}, |
980 |
|
'ffkk','peri','200-a-200-e', |
981 |
|
sub { |
982 |
|
first(rec(200,'a')).' '.first(rec('200','e')) |
983 |
|
} |
984 |
|
); |
985 |
|
|
986 |
|
Code like above will be B<automatically generated> using L<WebPAC::Parse> from |
987 |
|
normal lookup definition in C<conf/lookup/something.pl> which looks like: |
988 |
|
|
989 |
|
lookup( |
990 |
|
# which results to return from record recorded in lookup |
991 |
|
sub { 'ffkk/peri/mfn' . rec('000') }, |
992 |
|
# from which database and input |
993 |
|
'ffkk','peri', |
994 |
|
# such that following values match |
995 |
|
sub { first(rec(200,'a')) . ' ' . first(rec('200','e')) }, |
996 |
|
# if this part is missing, we will try to match same fields |
997 |
|
# from lookup record and current one, or you can override |
998 |
|
# which records to use from current record using |
999 |
|
sub { rec('900','x') . ' ' . rec('900','y') }, |
1000 |
|
) |
1001 |
|
|
1002 |
|
You can think about this lookup as SQL (if that helps): |
1003 |
|
|
1004 |
|
select |
1005 |
|
sub { what } |
1006 |
|
from |
1007 |
|
database, input |
1008 |
|
where |
1009 |
|
sub { filter from lookuped record } |
1010 |
|
having |
1011 |
|
sub { optional filter on current record } |
1012 |
|
|
1013 |
|
Easy as pie, right? |
1014 |
|
|
1015 |
=cut |
=cut |
1016 |
|
|
1017 |
sub lookup { |
sub lookup { |
1018 |
my $k = shift or return; |
my ($what, $database, $input, $key, $having) = @_; |
1019 |
return unless (defined($lookup->{$k})); |
|
1020 |
if (ref($lookup->{$k}) eq 'ARRAY') { |
confess "lookup needs 5 arguments: what, database, input, key, having" unless ($#_ == 4); |
1021 |
return @{ $lookup->{$k} }; |
|
1022 |
} else { |
warn "## lookup ($database, $input, $key)", $/ if ($debug > 1); |
1023 |
return $lookup->{$k}; |
return unless (defined($lookup->{$database}->{$input}->{$key})); |
1024 |
|
|
1025 |
|
confess "lookup really need load_ds_coderef added to data_structure\n" unless ($load_ds_coderef); |
1026 |
|
|
1027 |
|
my $mfns; |
1028 |
|
my @having = $having->(); |
1029 |
|
|
1030 |
|
warn "## having = ", dump( @having ) if ($debug > 2); |
1031 |
|
|
1032 |
|
foreach my $h ( @having ) { |
1033 |
|
if (defined($lookup->{$database}->{$input}->{$key}->{$h})) { |
1034 |
|
warn "lookup for $database/$input/$key/$h return ",dump($lookup->{$database}->{$input}->{$key}->{$h}),"\n"; |
1035 |
|
$mfns->{$_}++ foreach keys %{ $lookup->{$database}->{$input}->{$key}->{$h} }; |
1036 |
|
} |
1037 |
|
} |
1038 |
|
|
1039 |
|
return unless ($mfns); |
1040 |
|
|
1041 |
|
my @mfns = sort keys %$mfns; |
1042 |
|
|
1043 |
|
warn "# lookup loading $database/$input/$key mfn ", join(",",@mfns)," having ",dump(@having),"\n"; |
1044 |
|
|
1045 |
|
my $old_rec = $rec; |
1046 |
|
my @out; |
1047 |
|
|
1048 |
|
foreach my $mfn (@mfns) { |
1049 |
|
$rec = $load_ds_coderef->( $database, $input, $mfn ); |
1050 |
|
|
1051 |
|
warn "got $database/$input/$mfn = ", dump($rec), $/; |
1052 |
|
|
1053 |
|
my @vals = $what->(); |
1054 |
|
|
1055 |
|
push @out, ( @vals ); |
1056 |
|
|
1057 |
|
warn "lookup for mfn $mfn returned ", dump(@vals), $/; |
1058 |
} |
} |
1059 |
|
|
1060 |
|
# if (ref($lookup->{$k}) eq 'ARRAY') { |
1061 |
|
# return @{ $lookup->{$k} }; |
1062 |
|
# } else { |
1063 |
|
# return $lookup->{$k}; |
1064 |
|
# } |
1065 |
|
|
1066 |
|
$rec = $old_rec; |
1067 |
|
|
1068 |
|
warn "## lookup returns = ", dump(@out), $/; |
1069 |
|
|
1070 |
|
return @out; |
1071 |
|
} |
1072 |
|
|
1073 |
|
=head2 save_into_lookup |
1074 |
|
|
1075 |
|
Save value into lookup. It associates current database, input |
1076 |
|
and specific keys with one or more values which will be |
1077 |
|
associated over MFN. |
1078 |
|
|
1079 |
|
MFN will be extracted from first occurence current of field 000 |
1080 |
|
in current record, or if it doesn't exist from L<_set_config> C<_mfn>. |
1081 |
|
|
1082 |
|
my $nr = save_into_lookup($database,$input,$key,sub { |
1083 |
|
# code which produce one or more values |
1084 |
|
}); |
1085 |
|
|
1086 |
|
It returns number of items saved. |
1087 |
|
|
1088 |
|
This function shouldn't be called directly, it's called from code created by |
1089 |
|
L<WebPAC::Parser>. |
1090 |
|
|
1091 |
|
=cut |
1092 |
|
|
1093 |
|
sub save_into_lookup { |
1094 |
|
my ($database,$input,$key,$coderef) = @_; |
1095 |
|
die "save_into_lookup needs database" unless defined($database); |
1096 |
|
die "save_into_lookup needs input" unless defined($input); |
1097 |
|
die "save_into_lookup needs key" unless defined($key); |
1098 |
|
die "save_into_lookup needs CODE" unless ( defined($coderef) && ref($coderef) eq 'CODE' ); |
1099 |
|
|
1100 |
|
warn "## save_into_lookup rec = ", dump($rec), " config = ", dump($config), $/ if ($debug > 2); |
1101 |
|
|
1102 |
|
my $mfn = |
1103 |
|
defined($rec->{'000'}->[0]) ? $rec->{'000'}->[0] : |
1104 |
|
defined($config->{_mfn}) ? $config->{_mfn} : |
1105 |
|
die "mfn not defined or zero"; |
1106 |
|
|
1107 |
|
my $nr = 0; |
1108 |
|
|
1109 |
|
foreach my $v ( $coderef->() ) { |
1110 |
|
$lookup->{$database}->{$input}->{$key}->{$v}->{$mfn}++; |
1111 |
|
warn "# saved lookup $database/$input/$key [$v] $mfn\n" if ($debug > 1); |
1112 |
|
$nr++; |
1113 |
|
} |
1114 |
|
|
1115 |
|
return $nr; |
1116 |
} |
} |
1117 |
|
|
1118 |
=head2 config |
=head2 config |
1228 |
my $v = shift @r; |
my $v = shift @r; |
1229 |
warn "### first rec($fld,$sf) = ",dump($v),$/ if ($debug > 2); |
warn "### first rec($fld,$sf) = ",dump($v),$/ if ($debug > 2); |
1230 |
|
|
1231 |
return '' if( ! defined($v) || $v =~ /^\s*$/); |
return '' if ( ! defined($v) || $v =~ /^\s*$/); |
1232 |
|
|
1233 |
my @s = split( $regex, $v ); |
my @s = split( $regex, $v ); |
1234 |
warn "## split_rec_on($fld,$sf,$regex,$part) = ",dump(@s),$/ if ($debug > 1); |
warn "## split_rec_on($fld,$sf,$regex,$part) = ",dump(@s),$/ if ($debug > 1); |