[ic] Re: table drive component template for complex searches

Mike Heins interchange-users@icdevgroup.org
Wed Jun 12 21:23:01 2002


Quoting Barry Treahy, Jr. (Treahy@mmaz.com):
> Any ideas why this segment is not actually substituting the null for the 
> pipe?
> 
> [set FREQMAX][cgi FREQMAX][/set]
> [set POWER][cgi POWER][/set]
> [set VSWR][cgi VSWR][/set]
> [set BODY][cgi BODY][/set]
> [set GENDERS][cgi GENDERS][/set]
> [set INTERFACES][cgi INTERFACES][/set]
> [perl]
> $Scratch->{FREQMAX} =~ s/\0/|/g;
> $Scratch->{POWER} =~ s/\0/|/g;
> $Scratch->{VSWR} =~ s/\0/|/g;
> $Scratch->{BODY} =~ s/\0/|/g;
> $Scratch->{GENDERS} =~ s/\0/|/g;
> $Scratch->{INTERFACES} =~ s/\0/|/g;
> [/perl]
> 

Since you used [set ..] and not [seti ...], you are going
to get '[cgi FREQMAX]' etc. set in the string. It would make 
more sense to do:

    [perl]
	my @settings = qw/
			    FREQMAX
			    POWER
			    VSWR
			    BODY
			    GENDERS
			    INTERFACES
			/;
	for(@settings) {
	    ## Take care of that security, not ITL inputs!
	    $CGI->{$_} =~ s/\[//g;

	    $Scratch->{$_} = $CGI->{$_};
	    $Scratch->{$_} =~ s/\0/|/g;
	}
	return;
    [/perl]

-- 
Mike Heins
Perusion -- Expert Interchange Consulting
phone +1.513.523.7621      <mike@perusion.com>

How far can you open your mind before your brains fall out?