sub process(){ my $processed = $_[0]; return sub { if ( @_ ){ print "Sub Process called\n"; my ($colname,$colval) = @_; $colval =~ s/^&//; # strip leading & - this only occurs in + the 'ADDITIONAL field' print "Colname: $colname\n"; print "Colvalue: $colval\n"; # detect ADDITIONAL with multiple key value pairs. if ( index($colval,'&') >= 0 ){ print "$colval contaisn & character - so it's the ADDI +TIONAL field with multiple key value pairs"; my @additional = split('&',$colval); foreach my $addval (@additional){ print "additional has pair: $addval\n"; my @addpair = split('=',$addval); print "$addpair[0] | $addpair[1]\n"; process->($addpair[0], $addpair[1]); # this doesn' +t get called. } } # detect ors if ( index($colval,'|') >= 0 ){ print "$colval contains pipe character for ORs"; } # detect wildcards if ( index($colval,'*') >= 0 ){ print "$colval contains whidcard character"; } } } }
process->("TABLENAME",$TABLENAME) if defined($TABLENAME);
In reply to Re^2: Sub Routines and Building SQL statement
by Anonymous Monk
in thread Sub Routines and Building SQL statement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |