At 09:29 12.06.2001 -0500, you wrote:
>i am printing to the file currently via:
>
> open(FILE, ">>$filename");
> print FILE "$add_alias\@$domain\t$add_destination\n";
> close(FILE);
>
>so i am appending the appropriate domain to the new alias they are
>entering. overall, i want to ensure that $add_alias is composed
>strictly of a-z,A-Z,0-9,.,- and _ and nothing else.
then it doesn't sound like you're worried about finding a '@', it sounds
like you're worried about finding anything that is not A-Za-z0-9\.\-_ which
fits nicely into the following regular expression
print "You're cheating!" if($add_alias =~ /[^A-Za-z0-9\.\-_]/g);
or even more concise
print "You're cheating!" if($add_alias =~ /[^\w\.\-]/g); # \w Match a
"word" character (alphanumeric plus "_")
Aaron Craig
Programming
iSoftitler.com