$ cat 4.tk.pl #!/usr/bin/perl -w use 5.011; use utf8; use Config qw/%Config config_vars/; use lib "1.псы/template_stuff"; use utils1 qw/print_hash/; my $archname = $Config{'archname'}; print "<$archname>\n"; say "---------------"; config_vars( "archname", "version", "libpath", "perl", "scriptdir", "sitearchexp" ); say "---------------"; my $ref_Config = \%Config; print Dumper $ref_Config; # print() on unopened filehandle Dumper # print Dumper $Config; # Variable "$Config" is not imported print_hash($ref_Config); say "---------------"; use Path::Tiny; my ($archlibexp, $version) = ($Config{archlibexp},$Config{version}); my $arch_path = path($archlibexp)->parent; say "arch_path is $arch_path"; my $path_to_Config = path($arch_path,$version, "Config.pm"); my @lines = $path_to_Config->lines; say "lines are @lines"; say "---------------"; my $ref2_Config = \%Config::Config; print Dumper $ref2_Config; say "---------------"; use ExtUtils::MakeMaker::Config; say $Config{installbin}; say "---------------"; $Data::Dumper::Sortkeys = \&my_filter; my $foo = { map { (ord, "$_$_$_") } 'I'..'Q' }; say "foo is %$foo"; # print Dumper $foo; # print() on unopened filehandle Dumper print_hash($foo); my $bar = { %$foo }; my $baz = { reverse %$foo }; print Dumper [ $foo, $bar, $baz ]; sub my_filter { my ($hash) = @_; # return an array ref containing the hash keys to dump # in the order that you want them to be dumped return [ # Sort the keys of %$foo in reverse numeric order $hash eq $foo ? (sort {$b <=> $a} keys %$hash) : # Only dump the odd number keys of %$bar $hash eq $bar ? (grep {$_ % 2} keys %$hash) : # Sort keys in default order for all other hashes (sort keys %$hash) ]; } $