Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi, I'm using Sys::Syslog for program logging and I have just started using the taint flag (we are trying to tighten up our code). With this combination Syslog will not work. I'm thinking that it's a perl bug, but I wanted to check before I sent off a bug report. I'm also wondering if there is a way around the problem.

The following is the more detailed info:
I'm running perl 5.00503

This is my test script:
#!/usr/bin/perl -wT
use Sys::Syslog;

$SCRIPT_ID = "testMod.cgi(000)";
print "Content-Type: text/html\n\n";
&openlog($ProcName,"pid,cons,nowait", "local0");
&syslog('', "$SCRIPT_ID-1 Execution begun.");
print "HELLO";
When I run this script I get the 'document contained no data error' and the following message in the error log: 'Cannot get host name of local machine at /usr/lib/perl5/5.00503/Sys/ line 248' I tracked this down and found that the error is actually being generated from Sys::Hostname. Everything works fine if I remove the -T flag.

Thanks in advance,
Shane Corgatelli

In reply to Problems with Sys::Syslog and taint by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-11-28 04:57 GMT
Find Nodes?
    Voting Booth?