#!/usr/bin/perl # /media/fritz/175F-DC61/2022.bak/2.22.bak use v5.030; use Time::Piece; use Log::Log4perl; use IPC::System::Simple qw/systemx capturex/; use utf8; my ($argv1) = @ARGV; if (not defined $argv1) { die "Need argv1\n"; } my $t = localtime; my $jd = $t->julian_day; my $log_conf4 = '/home/fritz/Documents/perlmonks/conf_files/4.conf'; Log::Log4perl::init($log_conf4); #info my $logger = Log::Log4perl->get_logger(); $logger->info("Time is $t"); $logger->info("Julian day is $jd"); $logger->info("$0"); my $ini_path = qw( /home/fritz/Documents/perlmonks/conf_files/1.тайный.txt ); my $ref_config = get_тайный($ini_path); #$DB::single = 1; my %h = %$ref_config; my $capture = capturex "bash","6.git.sh", "@ARGV"; $logger->info("capx: $capture"); sub get_тайный { use Config::Tiny; use Data::Dump; my %h; #creating here and exporting reference to caller my $ini_path = shift; #caller provides inipath my $sub_hash1 = "gitlab"; my $Config = Config::Tiny->new; $Config = Config::Tiny->read( $ini_path, 'utf8' ); # -> is optional between brackets $h{email} = $Config->{$sub_hash1}{'email'}; $h{name} = $Config->{$sub_hash1}{'name'}; $h{pass} = $Config->{$sub_hash1}{'pass'}; my $sub_hash2 = "bash"; $h{bash_root} = $Config->{$sub_hash2}{'bash_root'}; my $ref_config = \%h; #dd $ref_config; $DB::single = 1; return ($ref_config); } __END__