in reply to Possible looping or syntax error

In addition, you should be using strict and warnings. Also, doing something like the following can help with naming issues.
if (param()) { my %values; $values{$_} = param($_) for qw( name search ); if ($values{search} eq 'Exact') { if ($values{name}) { if (exists $snailmail{$values{name}}) { } else { } } } elsif ($values{search} eq 'All') { } }

This makes sure you only enter keynames in once. The more times you type something, the more likely it is you will typo something.

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Possible looping or syntax error
by chromatic (Archbishop) on Dec 23, 2003 at 20:06 UTC

    It's true that the more code, the more potential bugs, but that technique removes perl's ability to warn about variable name typos, unless you're using a locked hash. Better to stick with first-class lexicals in this case.

      Also true. This is why I personally use the following variation:
      my $useful_object = Useful::Class->new; $useful_object->$_($cgi->param($_)) for qw( param1 param2 param3 );

      I get the benefits of hash naming with the benefits of Perl's watchful eye. (Albeit, at runtime and not compiletime, but a decent compromise, imho.)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.