[ic] Help with global sub

Shawn Mathews interchange-users@icdevgroup.org
Fri Oct 4 18:17:00 2002


Anybody know why this fails when I add it to my interchange.cfg?

GlobalSub <<EOF
 sub myextracheck {
        BEGIN {
            package Vend::Order;
            sub _pt_emailchk {
                # $ref is to Vend::Session->{'values'} hash
                # $var is the passed name of the variable
                # $val is current value of checked variable
                my($ref, $var, $val) = @_;
                if ($ref->{'email'} eq '') {
                   return (undef,$var,"Email Must be Specified!");
                };
                my $email = lc($ref->{'email'});
                my $sql = "select count(email) from userdb where
email='$email'";
                my ($cnt) = $Tag->query( { 'sql' => $sql  });
                return ($cnt == 0) ? (1,$var,'') : (undef,$var,"Email
Address $email already in use");

            }
        };
}
EOF

_________________________________________
Shawn Mathews
ICQ#: 157740601
More ways to contact me: http://wwp.icq.com/157740601
See more about me: http://web.icq.com/whitepages/about_me?Uin=157740601
_________________________________________