Question with Perl script

by "Christopher L. Filkins" <design(at)chronotope.com>

 Date:  Thu, 20 Dec 2001 14:46:18 -0800
 To:  <hwg-languages(at)hwg.org>
  todo: View Thread, Original
I can't seem to figure this out and was hoping to get some outside
opinions on this.  I am checking a string and would like to have one of
three results.

If the string is empty I want one result.  If the string falls into one
of these (1011,1012, or 1013) I want another result.  Or if the string
is not empty but falls outside of the &af; filter, for example 1014,
then I want a third result.

This script works well for 2 of the 3 but I can't seem to figure out why
I can't catch all three potential results.

I would appreciate any pointers on what I'm doing wrong.

TIA.

Chris


$null = "";
&af_check;
sub af_check {
     if ($querystring == $null) {
     $cfg = "z";
     } elsif ($cfg == $null) {
     &af;
     } elsif ($cfg == $null) {
     $cfg = "x";
     }	
}     

sub af {
     for ($querystring) { $cfg = /1011/ && "a"
     || /1012/ && "b"
     || /1013/ && "c"
     }
}
  

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA