I am defining a sub that takes only specific options:

sub error_notify
{
  my $ERR_USAGE = "error_notify (e,p,x, \"Message Text\")\n";

  foreach (@_)
  {
    if    (/^e$/)  { push @ERR_OPTS, "email";                         }
    elsif (/^p$/)  { push @ERR_OPTS, "page";                          }
    elsif (/^x$/)  { push @ERR_OPTS, "exit";                          }
    elsif (/^\w$/) { print "Invalid error_notify Option\n$ERR_USAGE";    }
    else           { $MESSAGE = $_; }
  }
  bla bla bla...

This sub is supposed to be called like this:
error_notify(e,p,x,"This is the error message that will be sent out");

The problem that I am running into is that whenever "q" (which isn't a valid option) 
is supplied
as an argument to the sub like this:
error_notify(q,"Whatever");

I get an error because the "q" is interpreted as a quote operator.  I am using a \w to 
try and
match all invalid options but \w will not match the q.  Anyone know a way around this? 
 I would
like to keep the same syntax for calling the sub.

-Michael McQuarrie

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to