in reply to
adding wtmp script into logwatch
You may certainly assume, here at least, that “your knowledge of Perl scripting is very low” will never be interpreted as “dumb.” Enjoy...
Meanwhile ... “one-liners” are funky at times, but it works much better to put the thing into a .pl file. Because otherwise (as is the case here...) you run smack-dab into the preferences and the peculiarities of whatever shell you happen to be using, with regards to quote-marks and so forth. With the possible exception of Windows’ so-called “PowerShell,” Windows’s interpretation of what is a decent shell is virtually non-existent. ahem. Build a wtmp script that invokes the Perl code by referencing the Perl code in a file.