From james at actionmessage.com Tue Jul 6 16:17:10 2021 From: james at actionmessage.com (James Briggs) Date: Tue, 6 Jul 2021 16:17:10 -0700 Subject: [sf-perl] Github Actions Workflows Repo for Perl and Other Languages Message-ID: <20210706231210.M28672@actionmessage.com> Hi folks. 1) Recently I created a repo to test using the Github Actions build feature with several programming languages, including Perl, in different directories simultaneously. Github Actions has a nice UI and seems very useful. The repo link is: https://github.com/jamesbriggs/gh-actions-demo The Perl-specific workflow YAML script (only 33 lines) is: https://github.com/jamesbriggs/gh-actions-demo/blob/master/.github/workflows/perl.yml The Perl workflow uses perl -c, prove and podchecker. Please reply with any suggestions or questions. 2) Let me know of any Perl or Devops jobs in SF or remote. Thanks, James Briggs From doomvox at gmail.com Thu Jul 8 18:46:29 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 8 Jul 2021 18:46:29 -0700 Subject: [sf-perl] The SF Perl Raku Study Group, 07/11 at 1pm PDT Message-ID: Heather McGhee, "The Sum of Us" (2021): "I fell in love with the idea that information, in the right hands, was power." The Raku Study Group July 11th, 2021 1pm in California, 8pm in the UK Zoom meeting link: https://us02web.zoom.us/j/84275775889?pwd=SXd6VW96bk1oZS85K0JOeWNSZU5zZz09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/279354456/ From dpchrist at holgerdanske.com Thu Jul 15 13:47:48 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Thu, 15 Jul 2021 13:47:48 -0700 Subject: [sf-perl] perlstyle Message-ID: San Francisco Perl Mongers: Regarding the "perlstyle" document [1]: 1. Under "Regarding aesthetics of code lay out ...", "Space after last parenthesis matching on current line" would seem to only make sense when additional code follows a closing parenthesis. E.g. if ( ... ) { ... } And: my $x = foo( ... ) && ... ; But not: my $z = bar( ... ); 2. Under "Along the same lines, just because you CAN omit parentheses ...", what is "num" in the example code? return print reverse sort num values %array; My Perl says: 2021-07-15 13:19:07 dpchrist at dipsy ~/sandbox/perl $ cat /etc/debian_version ; uname -a ; perl -v | head -n 2 | tail -n 1 10.10 Linux dipsy 4.19.0-17-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) x86_64 GNU/Linux This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux-gnu-thread-multi 2021-07-15 13:19:11 dpchrist at dipsy ~/sandbox/perl $ cat perlstyle-num.pl #!/usr/bin/env perl use strict; use warnings; my %array = ( a => 1, b => 2, c => 3 ); sub foo { return print reverse sort num values %array } foo(); 2021-07-15 13:19:25 dpchrist at dipsy ~/sandbox/perl $ perl perlstyle-num.pl Undefined sort subroutine "main::num" called at perlstyle-num.pl line 7. Comments? David [1] https://metacpan.org/dist/perl/view/pod/perlstyle.pod From miller.hall at gmail.com Thu Jul 15 14:33:29 2021 From: miller.hall at gmail.com (Miller Hall) Date: Thu, 15 Jul 2021 14:33:29 -0700 Subject: [sf-perl] perlstyle In-Reply-To: References: Message-ID: num in that context is a subroutine meant as a shortcut for numerical sorting. The more full example is the following #!/usr/bin/env perl use strict; use warnings; sub num { $a <=> $b; } my %array = ( a => 1, b => 2, c => 3 ); sub foo { return print reverse sort num values %array } foo(); You can read about this in the spec for sort https://perldoc.perl.org/functions/sort - Miller On Thu, Jul 15, 2021 at 1:48 PM David Christensen wrote: > San Francisco Perl Mongers: > > Regarding the "perlstyle" document [1]: > > 1. Under "Regarding aesthetics of code lay out ...", "Space after last > parenthesis matching on current line" would seem to only make sense when > additional code follows a closing parenthesis. E.g. > > if ( ... ) { > ... > } > > And: > > my $x = foo( ... ) && ... ; > > But not: > > my $z = bar( ... ); > > 2. Under "Along the same lines, just because you CAN omit parentheses > ...", what is "num" in the example code? > > return print reverse sort num values %array; > > My Perl says: > > 2021-07-15 13:19:07 dpchrist at dipsy ~/sandbox/perl > $ cat /etc/debian_version ; uname -a ; perl -v | head -n 2 | tail > -n 1 > 10.10 > Linux dipsy 4.19.0-17-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) > x86_64 GNU/Linux > This is perl 5, version 28, subversion 1 (v5.28.1) built for > x86_64-linux-gnu-thread-multi > > 2021-07-15 13:19:11 dpchrist at dipsy ~/sandbox/perl > $ cat perlstyle-num.pl > #!/usr/bin/env perl > use strict; > use warnings; > > my %array = ( a => 1, b => 2, c => 3 ); > > sub foo { return print reverse sort num values %array } > > foo(); > > 2021-07-15 13:19:25 dpchrist at dipsy ~/sandbox/perl > $ perl perlstyle-num.pl > Undefined sort subroutine "main::num" called at perlstyle-num.pl > line 7. > > > Comments? > > > David > > > [1] https://metacpan.org/dist/perl/view/pod/perlstyle.pod > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > https://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpchrist at holgerdanske.com Thu Jul 15 19:01:51 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Thu, 15 Jul 2021 19:01:51 -0700 Subject: [sf-perl] perlstyle In-Reply-To: References: Message-ID: > On Thu, Jul 15, 2021 at 1:48 PM David Christensen wrote: >> 2. Under "Along the same lines, just because you CAN omit >> parentheses ...", what is "num" in the example code? >> >> return print reverse sort num values %array; On 7/15/21 2:33 PM, Miller Hall wrote: > num in that context is a subroutine meant as a shortcut for numerical > sorting. > > The more full example is the following > > #!/usr/bin/env perl > > use strict; use warnings; > > sub num { $a <=> $b; } > > my %array = ( a => 1, b => 2, c => 3 ); > > sub foo { return print reverse sort num values %array } > > foo(); > > > You can read about this in the spec for sort > https://perldoc.perl.org/functions/sort > > - Miller Thank you for the reply. :-) Looking at the signatures for Perl sort: sort SUBNAME LIST sort BLOCK LIST sort LIST The way the example is written, "num" would appear to be a Perl built-in keyword or function, but it is not. This is confusing. Perhaps perlstyle(1) should use the Perl sort SUBNAME placeholder: return print reverse sort SUBNAME values %array; Going further in perlstyle(1), the next line of example code adds parentheses to the above: return print(reverse(sort num (values(%array)))); A reader might ask "why is there no opening parenthesis between 'sort' and 'num'?" and "why is there a space between 'num' and the following opening parenthesis?". I thought I understood, but the following console session convinced me that I do not. Thankfully, I rarely use the 'sort SUBNAME LIST' form, and must not have attempted parentheses if/when I did so. Perhaps perlstyle(1) should eliminate the parentheses around LIST: return print(reverse(sort SUBNAME values(%array))); Or, provide more justification for parentheses, to make it clear that a list is being passed: return print(reverse(sort SUBNAME (values(%array), @more_stuff))); Finally, %array is a hash. Perhaps perlstyle(1) should use %hash. So, I would suggest that the parentheses omission code examples in perlstyle(1) be changed to: return print reverse sort SUBNAME values %hash; return print(reverse(sort SUBNAME values(%hash))); David 2021-07-15 18:59:30 dpchrist at dipsy ~/sandbox/perl $ cat perlstyle-num-2.pl #!/usr/bin/env perl use strict; use warnings; $| = 1; my %hash = ( a => 1, b => 2, c => 3 ); sub num { $a <=> $b } my $num = 'num'; my $rc = \# my @more_stuff = (4, 5); print "\ncase 1: "; print reverse sort num values %hash; # case 1: 321 print "\ncase 2: "; print reverse sort $num values %hash; # case 2: 321 print "\ncase 3: "; print reverse sort $rc values %hash; # case 3: 321 #print "\ncase 4: "; #return print reverse sort 'num' values %hash; # syntax error at perlstyle-num-2.pl line 27, near "'num' values" #print "\ncase 5: "; #return print reverse sort \&num values %hash; # syntax error at perlstyle-num-2.pl line 31, near "&num values" print "\ncase 6: "; print(reverse(sort num (values(%hash)))); # case 6: 321 print "\ncase 7: "; print(reverse(sort(num (values(%hash))))); # Unquoted string "num" may clash with future reserved word at perlstyle-num-2.pl line 39. # case 7: 321 print "\ncase 8: "; print(reverse(sort num(values(%hash)))); # case 8: 321 print "\ncase 9: "; print(reverse(sort(num(values(%hash))))); # case 9: Use of uninitialized value $b in numeric comparison (<=>) at perlstyle-num-2.pl line 10. # Use of uninitialized value $a in numeric comparison (<=>) at perlstyle-num-2.pl line 10. # 0 print "\ncase 10: "; print(reverse(sort num values(%hash))); # case 10: 321 print "\ncase 11: "; print(reverse(sort num (values(%hash), @more_stuff))); # case 11: 54321 print "\n"; 2021-07-15 18:59:31 dpchrist at dipsy ~/sandbox/perl $ perl perlstyle-num-2.pl Unquoted string "num" may clash with future reserved word at perlstyle-num-2.pl line 41. case 1: 321 case 2: 321 case 3: 321 case 6: 321 case 7: 321 case 8: 321 case 9: Use of uninitialized value $b in numeric comparison (<=>) at perlstyle-num-2.pl line 10. Use of uninitialized value $a in numeric comparison (<=>) at perlstyle-num-2.pl line 10. 0 case 10: 321 case 11: 54321 From doomvox at gmail.com Thu Jul 22 11:52:16 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 22 Jul 2021 11:52:16 -0700 Subject: [sf-perl] The SF Perl Raku Study Group, 07/24, SATURDAY at 1pm PDT Message-ID: Paul Krugman, "Peddling Prosperity" (1994): "... there is a circularity: the network of support and reinforcement that makes a technology fully productive is both a cause and a result of that technology's widespread use. So a new technology, no matter how marvelous, may have only superficial effects for decades, then flower as it finally reaches critical mass." The Raku Study Group July 24, 2021, SATURDAY, 1pm in California, 8pm in the UK Zoom meeting link: https://us02web.zoom.us/j/89219572492?pwd=M1ZEMU5uRWtiNCtXZnU3dnp5OW1DUT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/279639325/ Note: this week we're bumping up the meeting from our usual Sunday session to Saturday, July 24th. And don't forget the Raku Conference coming up on August 6-8, 2021 https://conf.raku.org/