HEX
Server: Apache
System: Linux web2.fi.cloudlogin.co 5.10.241-xeon-hst #3 SMP Fri Aug 29 13:26:38 UTC 2025 x86_64
User: otjinenec (286614)
PHP: 8.3.25
Disabled: NONE
Upload Files
File: //bin/yamlpp-events
#!/usr/bin/perl
use strict;
use warnings;

use Encode;
use YAML::PP::Parser;
use YAML::PP::Common;

my ($file) = @ARGV;

my $parser = YAML::PP::Parser->new(
    receiver => sub {
      my ($self, undef, $event) = @_;
      print encode_utf8(YAML::PP::Common::event_to_test_suite($event, { flow => 1 })), "\n";
    },
    $file ? (reader => YAML::PP::Reader::File->new) : (),
);
if ($file) {
    $parser->parse_file($file);
}
else {
    my $yaml;
    $yaml = do { local $/; <STDIN> };
    $yaml = decode_utf8($yaml);
    $parser->parse_string($yaml);
}