I haven't used Win32::EventLog, but from your description, I think what is needed is the "bit bucket". On Windows there is a special reserved file name, "nul". This file is special. Anything written to the file called "nul" is discarded - it just goes away.

The name nul, will not appear in any directory listing as this file cannot exist. You can however open a filehandle to nul to "create it", write to it and close it. It will all look like a normal file operation except at the end of the day, a file called nul is never actually created. On Windows, case doesn't matter, NUL and nul are the same. The path doesn't matter. You can write to nul in any directory.

C:\Projects>type temp.txt #types temp.txt to stdout C:\Projects>type temp.txt >nul #no output! types temp.text into cyber +space
There are all sorts of handy uses for nul. Another example:
C:\someprog.pl 2>nul
exectues someprog.pl and the normal stdout output is thrown away. But anything written to stderr, like a warning or whatever will appear on the terminal.

In Unix, this concept is implemented via the device called null. /dev/null. Please note the spelling, and the number of letter l's! That is of course important!


In reply to Re: Win32::EventLog's clear method without filename. by Marshall
in thread Win32::EventLog's clear method without filename. by dannyd

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.