in reply to Numeric values required in Unix::Syslog?

It seems it want a numeric value, but is there a numeric value for LOG_PID?
man 3 syslog

It's a constant in syslog.h

Get rid of use constant. And get rid of @{[ LOGPID ]} - what is that for anyway? Constants should be bitwise or-ed. Like this: LOG_PID | LOG_CONS | LOG_WHATEVER. Those should be constants exported by Unix::Syslog, not your own.

Replies are listed 'Best First'.
Re^2: Numeric values required in Unix::Syslog?
by spoovy (Initiate) on Jan 20, 2015 at 09:43 UTC
    As above; barewords not allowed:
    # Open syslog channel openlog('my-program', LOG_PID, 3);
    [me@mgmt test-project (master)]# ./my-program.pl Bareword "LOG_PID" not allowed while "strict subs" in use at ./my-prog +ram.pl line 65.
      use Unix::Syslog qw( :macros )

      Also, you might want to read how Exporter works

        Thanks that was it, I didn't include :macros as I thought I didn't need it. Silly me. Thanks for your help though and I will read about Exporter as you suggest.