File: write_journal.pl

package info (click to toggle)
liblinux-systemd-perl 1.201600-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 284 kB
  • sloc: perl: 640; makefile: 7
file content (19 lines) | stat: -rwxr-xr-x 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env perl

use v5.10.1;
use strict;
use warnings;

use Linux::Systemd::Journal::Write;

my $jnl = Linux::Systemd::Journal::Write->new;

$jnl->print('flarg');
$jnl->print('Hello world', 4);

my %hash =
  (DAY_ONE => 'Monday', DAY_TWO => 'Tuesday', DAY_THREE => 'Wednesday');
$jnl->send('Here is a message', \%hash);

open my $fh, '<', 'nosuchfile'
  or $jnl->perror('Failed to open some fake file');