On Dec 5, Michael McQuarrie said:

>The "use strict;" requires the arguments to all be quoted.  In the real
>script I am only using "use strict 'vars';".  This way I can keep the
>syntax of calling the sub the same as I originally had.  I would like to
>keep the "error_notify(e,p,x,"Message");" syntax.  The "q" is the only
>character that is causing me problems with this.

Honestly, this is a job for flags.

  use constant E => 0x01;
  use constant P => 0x02;
  use constant X => 0x04;

Then, you call your function like so:

  foobar(E | P, "message");

And the function does:

  sub foobar {
    my ($mode, $msg) = @_;
    if ($mode & E) { ... }
    if ($mode & P) { ... }
    if ($mode & X) { ... }
    ...
  }

But you really shouldn't be using single characters -- that's really ugly,
and you CERTAINLY should be quoting your strings.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


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

Reply via email to