- my $cust_obj = new FS::cust_main;
- $cust_obj->setfield('last', $cgi->param('last_text'));
- my $error = $cust_obj->ut_name('last');
- eidiot "Illegal last name" if $error;
- my($last) = $cust_obj->getfield('last');
+ $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/
+ or eidiot "Illegal last name";
+ my($last)=$1;