key 'user' vs. 'username' don't go together...

Du hast ein ganz genaues Auge, soonix, vielen Dank. I realize that I'm still nibbling at the edges of this topic, but sometimes I can't get going north and south until I get past some bonehead thing that someone else can better see. I removed the variable for login. For people like me who like to use Config::Tiny, this would be determined in the ini file.

#!/usr/bin/perl use 5.011; use warnings; # original by bliako on 27/05/2019 PM node_id=11100309 # values imported by Config::Tiny by Aldebaran # repo_name supplied to STDIN use Net::GitHub; use Data::Dumper; use Config::Tiny; my $ini_path = qw( /home/bob/Documents/html_template_data/3.values.ini + ); say "ini path is $ini_path"; my $sub_hash = "my_github"; my $Config = Config::Tiny->new; $Config = Config::Tiny->read( $ini_path, 'utf8' ); say Dumper $Config; my $user = $Config->{$sub_hash}{'username'}; my $pass = $Config->{$sub_hash}{'password'}; print "$0 : enter value for reponame: "; my $repo_name = <STDIN>; chomp($repo_name); my $git = Net::GitHub->new( login => $user, pass => $pass ); say "username is $user"; my $reposinfo = $git->repos->list($user); print Dumper($reposinfo); my %reposlist = map { lc $_->{'full_name'} =~ s|^${user}/||r => $_ } @$reposinfo; print "Repos: " . join( ",", keys %reposlist ) . "\n"; if ( !defined $reposlist{ lc $repo_name } ) { print "$0 : creating new repository '$repo_name' ...\n"; my $ret = undef; eval { $ret = $git->repos->create( { name => $repo_name, description => "change this to suit", } ); }; if ($@) { print STDERR "$0 : failed to create repository '$repo_name' : $@\n +"; exit(1); } } __END__

What is happening with this snippet?

my %reposlist = map { lc $_->{'full_name'} =~ s|^${user}/||r => $_ } @$reposinfo; print "Repos: " . join( ",", keys %reposlist ) . "\n";

The output is pretty clear but rather verbose:

'created_at' => '2019-02-26T07:24:14Z', 'keys_url' => 'https://api.github.com/repos/TBlazer66/SSCC +E/keys{/key_id}', 'subscribers_url' => 'https://api.github.com/repos/TBlazer +66/SSCCE/subscribers', 'branches_url' => 'https://api.github.com/repos/TBlazer66/ +SSCCE/branches{/branch}', 'releases_url' => 'https://api.github.com/repos/TBlazer66/ +SSCCE/releases{/id}',

Now I'm going to try to tackle the code in the original post....


In reply to Re^5: git-push target for Makefile (via ExtUtils::MakeMaker) by Aldebaran
in thread git-push target for Makefile (via ExtUtils::MakeMaker) by bliako

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.