annotate Lib/IMPL/lang.pm @ 213:d6e2ea24af08

sync
author sergey
date Fri, 03 Aug 2012 01:15:15 +0400
parents 6adaeb86945d
children 6d8092d8ce1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
1 package IMPL::lang;
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
2 use strict;
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
3 use warnings;
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
4
165
76515373dac0 Added Class::Template,
wizard
parents: 164
diff changeset
5 use parent qw(Exporter);
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
6 use IMPL::_core::version;
173
aaab45153411 minor bugfixes
sourcer
parents: 169
diff changeset
7 use IMPL::clone qw(clone);
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
8
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
9 require IMPL::Class::PropertyInfo;
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
10
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
11 our @EXPORT = qw(&is);
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
12 our %EXPORT_TAGS = (
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
13 base => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
14 qw(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
15 &is
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
16 &clone
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
17 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
18 ],
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
19 constants => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
20 qw(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
21 &ACCESS_PUBLIC
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
22 &ACCESS_PROTECTED
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
23 &ACCESS_PRIVATE
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
24 &PROP_GET
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
25 &PROP_SET
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
26 &PROP_OWNERSET
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
27 &PROP_LIST
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
28 &PROP_ALL
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
29 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
30 ],
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
31
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
32 declare => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
33 qw(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
34 &public
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
35 &protected
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
36 &private
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
37 &virtual
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
38 &property
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
39 &static
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
40 &property
213
sergey
parents: 210
diff changeset
41 &ACCESS_PUBLIC
sergey
parents: 210
diff changeset
42 &ACCESS_PROTECTED
sergey
parents: 210
diff changeset
43 &ACCESS_PRIVATE
sergey
parents: 210
diff changeset
44 &PROP_GET
sergey
parents: 210
diff changeset
45 &PROP_SET
sergey
parents: 210
diff changeset
46 &PROP_OWNERSET
sergey
parents: 210
diff changeset
47 &PROP_LIST
sergey
parents: 210
diff changeset
48 &PROP_ALL
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
49 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
50 ],
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
51 compare => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
52 qw(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
53 &equals
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
54 &equals_s
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
55 &hashCompare
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
56 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
57 ],
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
58 hash => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
59 qw(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
60 &hashApply
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
61 &hashMerge
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
62 &hashDiff
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
63 &hashCompare
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
64 &hashParse
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
65 &hashSave
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
66 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
67 ]
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
68 );
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
69
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
70 our @EXPORT_OK = keys %{ { map (($_,1) , map (@{$_}, values %EXPORT_TAGS) ) } };
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
71
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
72 use constant {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
73 ACCESS_PUBLIC => 1,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
74 ACCESS_PROTECTED => 2,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
75 ACCESS_PRIVATE => 3,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
76 PROP_GET => 1,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
77 PROP_SET => 2,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
78 PROP_OWNERSET => 10,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
79 PROP_LIST => 4,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
80 PROP_ALL => 3
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
81 };
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
82
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
83 sub is($$) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
84 eval { $_[0]->isa( $_[1] ) };
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
85 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
86
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
87 sub virtual($) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
88 $_[0]->Virtual(1);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
89 $_[0];
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
90 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
91
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
92 sub public($) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
93 $_[0]->Access(ACCESS_PUBLIC);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
94 $_[0]->Implement;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
95 $_[0];
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
96 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
97
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
98 sub private($) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
99 $_[0]->Access(ACCESS_PRIVATE);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
100 $_[0]->Implement;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
101 $_[0];
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
102 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
103
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
104 sub protected($) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
105 $_[0]->Access(ACCESS_PROTECTED);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
106 $_[0]->Implement;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
107 $_[0];
164
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
108 }
eb3e9861a761 SQL traits in progress
wizard
parents:
diff changeset
109
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
110 sub property($$;$) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
111 my ( $propName, $mutators, $attributes ) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
112 my $Info = new IMPL::Class::PropertyInfo(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
113 {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
114 Name => $propName,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
115 Mutators => $mutators,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
116 Class => scalar(caller),
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
117 Attributes => $attributes
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
118 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
119 );
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
120 return $Info;
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
121 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
122
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
123 sub static($$) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
124 my ( $name, $value ) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
125 my $class = caller;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
126 $class->static_accessor( $name, $value );
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
127 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
128
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
129 sub equals {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
130 if (defined $_[0]) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
131 return 0 if (not defined $_[1]);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
132
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
133 return $_[0] == $_[1];
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
134 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
135 return 0 if defined $_[1];
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
136
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
137 return 1;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
138 }
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
139 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
140
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
141 sub equals_s {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
142 if (defined $_[0]) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
143 return 0 if (not defined $_[1]);
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
144
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
145 return $_[0] eq $_[1];
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
146 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
147 return 0 if defined $_[1];
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
148
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
149 return 1;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
150 }
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
151 }
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
152
168
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
153 sub hashDiff {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
154 my ($src,$dst) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
155
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
156 $dst = $dst ? { %$dst } : {} ;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
157 $src ||= {};
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
158
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
159 my %result;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
160
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
161 foreach my $key ( keys %$src ) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
162 if (exists $dst->{$key}) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
163 $result{"+$key"} = $dst->{$key} unless equals_s($dst->{$key}, $src->{$key});
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
164 delete $dst->{$key};
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
165 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
166 $result{"-$key"} = 1;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
167 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
168 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
169
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
170 $result{"+$_"} = $dst->{$_} foreach keys %$dst;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
171
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
172 return \%result;
168
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
173 }
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
174
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
175 sub hashMerge {
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 194
diff changeset
176 return hashApply( { %{$_[0] || {}} }, $_[1] );
168
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
177 }
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
178
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
179 sub hashApply {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
180 my ($target,$diff) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
181
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
182 while ( my ($key,$value) = each %$diff) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
183 $key =~ /^(\+|-)?(.*)$/;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
184 my $op = $1 || '+';
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
185 $key = $2;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
186
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
187 if ($op eq '-') {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
188 delete $target->{$key};
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
189 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
190 $target->{$key} = $value;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
191 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
192 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
193
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
194 return $target;
168
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
195 }
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
196
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
197 sub hashCompare {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
198 my ($l,$r,$cmp) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
199
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
200 $cmp ||= \&equals_s;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
201
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
202 return 0 unless scalar keys %$l == scalar keys %$r;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
203 &$cmp($l->{$_},$r->{$_}) || return 0 foreach keys %$l;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
204
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
205 return 1;
168
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
206 }
6148f89bb7bf IMPL::SQL::Schema::Traits::Diff alfa version
sourcer
parents: 167
diff changeset
207
174
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
208 sub hashParse {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
209 my ($s,$p,$d) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
210
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
211 $p = $p ? qr/$p/ : qr/\n+/;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
212 $d = $d ? qr/$d/ : qr/\s*=\s*/;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
213
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
214 return {
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
215 map split($d,$_,2), split($p,$s)
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
216 };
174
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
217 }
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
218
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
219 sub hashSave {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
220 my ($hash,$p,$d) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
221
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
222 return "" unless ref $hash eq 'HASH';
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
223
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
224 $p ||= "\n";
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
225 $d ||= " = ";
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
226
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
227 return
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
228 join(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
229 $p,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
230 map(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
231 join(
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
232 $d,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
233 $_,
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
234 $hash->{$_}
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
235 ),
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
236 keys %$hash
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
237 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 181
diff changeset
238 );
174
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
239 }
d920d2b70230 minor changes
sergey
parents: 173
diff changeset
240
167
1f7a6d762394 SQL schema in progress
sourcer
parents: 165
diff changeset
241 1;