Hi,
my ($str) = "HI, HELLO, GREETINGS";
my ($reg) = "(BYE|HI|CIAO)";
if ($str =~ /$reg/)
{ print "Exists in $str\n"; }
The above code, will return true if BYE, HI or CIAO exists
in $str.
I want a regex to be put in $reg, which will return true
if neither BYE, HI nor CIAO exists in $str.
I could've done something like:
if ($str !~ /$reg/)
{ ... }
but, I don't want to change the code, just $reg.
I've been trying to find something in Programming Perl,
but couldn't.
Does anyone know how you can do this??
Thanks.
George P.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]