Search notes:

Perl module YAML::Tiny

use warnings;
use strict;
use feature 'say';
use YAML::Tiny;

my $yaml_file = 'data.yaml';

unless (-e $yaml_file) {

  my %data = (

    'foo' => 42,
    'bar' => 'baz',
    'inner_hash' => {
      one => 1,
      two => 2
    }
  );

  my $yaml = YAML::Tiny->new(\%data);

  $yaml->write($yaml_file);

  exit 0;

}

my $yaml = YAML::Tiny->read($yaml_file);
my %data = %{ $yaml->[0] };

say $data{foo};
say $data{bar};
say $data{inner_hash}{one};
say $data{inner_hash}{two};
Github repository PerlModules, path: /YAML/Tiny/script.pl
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741107508, '3.149.214.156', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/YAML/Tiny/index(69): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78