From doomvox at gmail.com Thu Feb 4 19:39:43 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 4 Feb 2021 19:39:43 -0800 Subject: [sf-perl] The SF Perl Raku Study Group, 02/07 1pm PDT Message-ID: Leo Tolstoy, "Anna Karenina": "After wavering for some time between various kinds of art-- religious, historical, genre or realistic-- he began to paint. He understood all the different kinds and was able to draw inspiration from all, but he could not imagine that it is possible to be quite ignorant of the different kinds of art and to be inspired directly by what is in one's own soul, regardless of whether what one paints belongs to any particular school." The Raku Study Group February 7th, 2021 1pm in California, 9pm in the UK Zoom meeting link: https://us02web.zoom.us/j/84111464035?pwd=UVJKS0J2UWFUUkN5SkJTNWhkTE1Cdz09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/276184838/ From sneha.rudravaram at gmail.com Fri Feb 5 22:49:53 2021 From: sneha.rudravaram at gmail.com (sneha rudravaram) Date: Fri, 5 Feb 2021 22:49:53 -0800 Subject: [sf-perl] need help understanding perl Message-ID: hello folks i am very new to perl. i am trying to use the below code from CPAN. my $C; # Recursive version of C;sub reach { my $ref = shift; if (ref $ref eq 'HASH') { if (defined $C->{$ref}{v}) { if (ref $C->{$ref}{v} eq 'HASH') { if (my @rec = reach($C->{$ref}{v})) { return ($C->{$ref}{k}, at rec); } } elsif (ref $C->{$ref}{v} eq 'ARRAY') { if (my @rec = reach($C->{$ref}{v})) { if (defined $C->{$ref}{k}) { return $C->{$ref}{k}, at rec; } return @rec; } } undef $C->{$ref}; } if (my ($k,$v) = each %$ref) { $C->{$ref}{v} = $v; $C->{$ref}{k} = $k; return ($k,reach($v)); } return (); } elsif (ref $ref eq 'ARRAY') { if (defined $C->{$ref}{v}) { if (ref $C->{$ref}{v} eq 'HASH' || ref $C->{$ref}{v} eq 'ARRAY') { if (my @rec = reach($C->{$ref}{v})) { if (defined $C->{$ref}{k}) { return $C->{$ref}{k}, at rec; } return @rec; } } } if (my $v = $ref->[$C->{$ref}{i}++ || 0]) { $C->{$ref}{v} = $v; return (reach($v)); } return (); } return $ref; } input: bar => {cmd_opts => { gld_upf => ['abc' , 'def']} } current output: [bar, cmd_opts, gld_upf, abc] [bar, cmd_opts, gld_upf, def] desired output: [bar, cmd_opts, gld_upf, ['abc', 'def']] also, what are the concepts that are being used in this code? are there any books/courses i can take for this? thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From merlyn at stonehenge.com Sat Feb 6 06:48:33 2021 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Sat, 06 Feb 2021 06:48:33 -0800 Subject: [sf-perl] need help understanding perl In-Reply-To: (sneha rudravaram's message of "Fri, 5 Feb 2021 22:49:53 -0800") References: Message-ID: <86eehtntfi.fsf@red.stonehenge.com> >>>>> "sneha" == sneha rudravaram writes: sneha> hello folks i am very new to perl. Welcome! sneha> also, what are the concepts that are being used in this code? are sneha> there any books/courses i can take for this? I could recommend a couple of good books, but I'll leave that for the others. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Dart/Flutter consulting, Technical writing, Comedy, etc. etc. Still trying to think of something clever for the fourth line of this .sig From dpchrist at holgerdanske.com Sat Feb 6 13:28:30 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Sat, 6 Feb 2021 13:28:30 -0800 Subject: [sf-perl] need help understanding perl In-Reply-To: References: Message-ID: On 2021-02-05 22:49, sneha rudravaram wrote: > hello folks > i am very new to perl. Welcome! :-) > i am trying to use the below code from CPAN. Please provide a URL for the CPAN code. Have you made any changes to the code? > my $C; > # Recursive version of C;sub reach { > my $ref = shift; > > > if (ref $ref eq 'HASH') { > > > if (defined $C->{$ref}{v}) { > if (ref $C->{$ref}{v} eq 'HASH') { > if (my @rec = reach($C->{$ref}{v})) { > return ($C->{$ref}{k}, at rec); > } > } elsif (ref $C->{$ref}{v} eq 'ARRAY') { > if (my @rec = reach($C->{$ref}{v})) { > if (defined $C->{$ref}{k}) { > return $C->{$ref}{k}, at rec; > } > return @rec; > } > > } > undef $C->{$ref}; > } > > > if (my ($k,$v) = each %$ref) { > $C->{$ref}{v} = $v; > $C->{$ref}{k} = $k; > return ($k,reach($v)); > } > > return (); > > > } elsif (ref $ref eq 'ARRAY') { > > > if (defined $C->{$ref}{v}) { > if (ref $C->{$ref}{v} eq 'HASH' || > ref $C->{$ref}{v} eq 'ARRAY') { > > if (my @rec = reach($C->{$ref}{v})) { > if (defined $C->{$ref}{k}) { > return $C->{$ref}{k}, at rec; > } > return @rec; > } > } > } > > > > if (my $v = $ref->[$C->{$ref}{i}++ || 0]) { > $C->{$ref}{v} = $v; > return (reach($v)); > } > > return (); > } > return $ref; > } That code is a fragment, and not a complete program. It appears the subroutine 'reach' is doing a recursive depth-first search of the data structure referred to by the package lexical variable '$C', looking for the parameter '$ref', and returning various things depending upon the argument and what is found (or not found). Please post the complete program or its URL. Is there documentation? If so, please post its URL. > input: bar => {cmd_opts => { gld_upf => ['abc' , 'def']} } current > output: [bar, cmd_opts, gld_upf, abc] > > [bar, cmd_opts, gld_upf, def] > > desired output: [bar, cmd_opts, gld_upf, ['abc', 'def']] For sample runs, please post complete console sessions -- prompt, command entered, output produced, etc.. > also, what are the concepts that are being used in this code? Subroutines -- definitions, context, arguments (outside), parameters (inside; @_), return values. Expression evaluation. Conditionals. Variables -- singular (scalars), collections (arrays, hashes), references, allocation, initialization, assignment, discarding. Recursion. > are there any books/courses i can take for this? I started with "Programming Perl" (2 e.?). It is the canonical reference manual for Perl: https://www.oreilly.com/library/view/programming-perl-4th/9781449321451/ I was baffled and discouraged. Fortunately, there was "Learning Perl". I recall reading, typing in the examples, and doing the exercises for the first half of the book in under a day, and loving it. I recommend that you start here: https://www.oreilly.com/library/view/learning-perl-7th/9781491954317/ I also found the "Perl Cookbook" to be very helpful: https://www.oreilly.com/library/view/perl-cookbook-2nd/0596003137/ I consider the above three books to be the canonical Perl texts. These, plus the Internet, will allow you to understand many Perl programs and to write your own. That said, there are many additional Perl books that I found to be useful. "Intermediate Perl" would be very helpful for the above code: https://www.oreilly.com/library/view/intermediate-perl/0596102062/ A university education in computer science would be helpful; notably courses in data structures and algorithms. I have not attended any Perl classes. The Perl Beginner's mailing list was help when I was starting: https://lists.perl.org/list/beginners.html David From deehun at gmail.com Sat Feb 6 15:53:54 2021 From: deehun at gmail.com (al s) Date: Sat, 6 Feb 2021 15:53:54 -0800 Subject: [sf-perl] need help understanding perl In-Reply-To: References: Message-ID: Some of the prior questions are answered by the post here: https://stackoverflow.com/questions/66074268/need-to-modify-perl-deephashutils So the code fragment comes from Deep::Hash::Utils. There are simpler ways of doing what you need based on your single example, but the followup in the above post makes a good point: *Need to clarify what precisely you want -- in general, not only for the given input example. To leave array-references as they are? Um ... all of them? What if they contain hashrefs, like [ { a => 1 }, 'b' ]?* Anyway, I wouldn't try to start learning perl by reading arcane CPAN code. That's likely to end in disaster. Arcane library code of any language is going to be hard to decipher for a beginner. But if you really want to change the reach() code, just don't traverse the array ref (with the caveat that this will also not traverse hash inside an array refs). If you want better help, you'll need to be more specific and give a few more examples of what you are trying to do. On Sat, Feb 6, 2021 at 1:29 PM David Christensen wrote: > On 2021-02-05 22:49, sneha rudravaram wrote: > > hello folks > > i am very new to perl. > > Welcome! :-) > > > > i am trying to use the below code from CPAN. > > Please provide a URL for the CPAN code. > > > Have you made any changes to the code? > > > > my $C; > > # Recursive version of C;sub reach { > > my $ref = shift; > > > > > > if (ref $ref eq 'HASH') { > > > > > > if (defined $C->{$ref}{v}) { > > if (ref $C->{$ref}{v} eq 'HASH') { > > if (my @rec = reach($C->{$ref}{v})) { > > return ($C->{$ref}{k}, at rec); > > } > > } elsif (ref $C->{$ref}{v} eq 'ARRAY') { > > if (my @rec = reach($C->{$ref}{v})) { > > if (defined $C->{$ref}{k}) { > > return $C->{$ref}{k}, at rec; > > } > > return @rec; > > } > > > > } > > undef $C->{$ref}; > > } > > > > > > if (my ($k,$v) = each %$ref) { > > $C->{$ref}{v} = $v; > > $C->{$ref}{k} = $k; > > return ($k,reach($v)); > > } > > > > return (); > > > > > > } elsif (ref $ref eq 'ARRAY') { > > > > > > if (defined $C->{$ref}{v}) { > > if (ref $C->{$ref}{v} eq 'HASH' || > > ref $C->{$ref}{v} eq 'ARRAY') { > > > > if (my @rec = reach($C->{$ref}{v})) { > > if (defined $C->{$ref}{k}) { > > return $C->{$ref}{k}, at rec; > > } > > return @rec; > > } > > } > > } > > > > > > > > if (my $v = $ref->[$C->{$ref}{i}++ || 0]) { > > $C->{$ref}{v} = $v; > > return (reach($v)); > > } > > > > return (); > > } > > return $ref; > > } > > That code is a fragment, and not a complete program. It appears the > subroutine 'reach' is doing a recursive depth-first search of the data > structure referred to by the package lexical variable '$C', looking for > the parameter '$ref', and returning various things depending upon the > argument and what is found (or not found). > > > Please post the complete program or its URL. > > > Is there documentation? If so, please post its URL. > > > > input: bar => {cmd_opts => { gld_upf => ['abc' , 'def']} } current > > output: [bar, cmd_opts, gld_upf, abc] > > > > [bar, cmd_opts, gld_upf, def] > > > > desired output: [bar, cmd_opts, gld_upf, ['abc', 'def']] > > > For sample runs, please post complete console sessions -- prompt, > command entered, output produced, etc.. > > > > also, what are the concepts that are being used in this code? > > Subroutines -- definitions, context, arguments (outside), parameters > (inside; @_), return values. > > Expression evaluation. > > Conditionals. > > Variables -- singular (scalars), collections (arrays, hashes), > references, allocation, initialization, assignment, discarding. > > Recursion. > > > > are there any books/courses i can take for this? > > I started with "Programming Perl" (2 e.?). It is the canonical > reference manual for Perl: > > > https://www.oreilly.com/library/view/programming-perl-4th/9781449321451/ > > > I was baffled and discouraged. Fortunately, there was "Learning Perl". > I recall reading, typing in the examples, and doing the exercises for > the first half of the book in under a day, and loving it. I recommend > that you start here: > > https://www.oreilly.com/library/view/learning-perl-7th/9781491954317/ > > > I also found the "Perl Cookbook" to be very helpful: > > https://www.oreilly.com/library/view/perl-cookbook-2nd/0596003137/ > > > I consider the above three books to be the canonical Perl texts. These, > plus the Internet, will allow you to understand many Perl programs and > to write your own. > > > That said, there are many additional Perl books that I found to be > useful. "Intermediate Perl" would be very helpful for the above code: > > https://www.oreilly.com/library/view/intermediate-perl/0596102062/ > > > A university education in computer science would be helpful; notably > courses in data structures and algorithms. I have not attended any Perl > classes. > > > The Perl Beginner's mailing list was help when I was starting: > > https://lists.perl.org/list/beginners.html > > > David > _______________________________________________ > 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 Feb 11 20:27:01 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Thu, 11 Feb 2021 20:27:01 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 Message-ID: sanfrancisco-pm: I have a 2015 MacBook Pro that I recently updated to macOS 11.2.1 "Big Sur". 2021-02-11 20:17:16 dpchrist at MacBook-Pro ~ $ uname -a Darwin MacBook-Pro.tracy.holgerdanske.com 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64 2021-02-11 20:19:46 dpchrist at MacBook-Pro ~ $ perl -v This is perl 5, version 28, subversion 2 (v5.28.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) ... 2021-02-11 20:20:08 dpchrist at MacBook-Pro ~ $ perl -MExtUtils::MakeMaker -e 'print $ExtUtils::MakeMaker::VERSION, "\n"' 7.34 Creation of Perl distribution makefiles is now broken: 2021-02-11 20:21:08 dpchrist at MacBook-Pro ~ $ h2xs -X -A -n MacOS::Foo Defaulting to backwards compatibility with perl 5.28.2 If you intend this module to be compatible with earlier perl versions, please specify a minimum perl version with the -b option. Writing MacOS-Foo/lib/MacOS/Foo.pm Writing MacOS-Foo/Makefile.PL Writing MacOS-Foo/README Writing MacOS-Foo/t/MacOS-Foo.t Writing MacOS-Foo/Changes Writing MacOS-Foo/MANIFEST 2021-02-11 20:21:42 dpchrist at MacBook-Pro ~ $ cd MacOS-Foo/ 2021-02-11 20:21:48 dpchrist at MacBook-Pro ~/MacOS-Foo $ perl Makefile.PL Checking if your kit is complete... Segmentation fault: 11 Suggestions? David From doomvox at gmail.com Thu Feb 11 21:39:02 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 11 Feb 2021 21:39:02 -0800 Subject: [sf-perl] The SF Perl Raku Study Group, 02/14 at 1pm PDT Message-ID: Juanita Nelson, "A Matter of Freedom" from "Seeds of Liberation" (1964) edited by Paul Goodman: "How could I presume to have so much of the truth that I would defy constituted authority? What made me so certain of myself in this regard? I was not certain. But it seemed to me that if I should see only one thing clearly, it was not necessary to see all things clearly in order to act on the one thing." The Raku Study Group February 14, 2021 1pm in California, 9pm in the UK Zoom meeting link: https://us02web.zoom.us/j/88310040715?pwd=QWUwcnlqY0ZJUkd2UklVWDg0KzMrZz09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/276323379/ From doomvox at gmail.com Thu Feb 11 21:51:10 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 11 Feb 2021 21:51:10 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: That sounds pretty crazy... Are familiar with the perl debugger? You could try running with "perl -d", then single stepping ("n" or maybe "s") repeatedly to narrow down where it's segfaulting. A random thought: you could try initializing the module differently, rather than using h2xs. Or try basing it on something besides ExtUtils::Makemaker? On 2/11/21, David Christensen wrote: > sanfrancisco-pm: > > I have a 2015 MacBook Pro that I recently updated to macOS 11.2.1 "Big > Sur". > > 2021-02-11 20:17:16 dpchrist at MacBook-Pro ~ > $ uname -a > Darwin MacBook-Pro.tracy.holgerdanske.com 20.3.0 Darwin Kernel Version > 20.3.0: Thu Jan 21 00:07:06 PST 2021; > root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64 > > 2021-02-11 20:19:46 dpchrist at MacBook-Pro ~ > $ perl -v > > This is perl 5, version 28, subversion 2 (v5.28.2) built for > darwin-thread-multi-2level > (with 2 registered patches, see perl -V for more detail) > ... > > 2021-02-11 20:20:08 dpchrist at MacBook-Pro ~ > $ perl -MExtUtils::MakeMaker -e 'print $ExtUtils::MakeMaker::VERSION, "\n"' > 7.34 > > > Creation of Perl distribution makefiles is now broken: > > 2021-02-11 20:21:08 dpchrist at MacBook-Pro ~ > $ h2xs -X -A -n MacOS::Foo > Defaulting to backwards compatibility with perl 5.28.2 > If you intend this module to be compatible with earlier perl versions, > please > specify a minimum perl version with the -b option. > > Writing MacOS-Foo/lib/MacOS/Foo.pm > Writing MacOS-Foo/Makefile.PL > Writing MacOS-Foo/README > Writing MacOS-Foo/t/MacOS-Foo.t > Writing MacOS-Foo/Changes > Writing MacOS-Foo/MANIFEST > > 2021-02-11 20:21:42 dpchrist at MacBook-Pro ~ > $ cd MacOS-Foo/ > > 2021-02-11 20:21:48 dpchrist at MacBook-Pro ~/MacOS-Foo > $ perl Makefile.PL > Checking if your kit is complete... > Segmentation fault: 11 > > > Suggestions? > > David > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > https://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > -- > To unsubscribe from this group and stop receiving emails from it, send an > email to doom+unsubscribe at kzsu.stanford.edu. > > From dpchrist at holgerdanske.com Thu Feb 11 22:39:57 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Thu, 11 Feb 2021 22:39:57 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: On 2021-02-11 21:51, Joseph Brenner wrote: > On 2/11/21, David Christensen wrote: >> 2021-02-11 20:21:48 dpchrist at MacBook-Pro ~/MacOS-Foo $ perl >> Makefile.PL Checking if your kit is complete... Segmentation fault: >> 11 > That sounds pretty crazy... > > Are familiar with the perl debugger? You could try running with > "perl -d", then single stepping ("n" or maybe "s") repeatedly to > narrow down where it's segfaulting. > > A random thought: you could try initializing the module differently, > rather than using h2xs. Or try basing it on something besides > ExtUtils::Makemaker? Thanks for the ideas. :-) Using the Perl debugger, entering 's', and then leaning on the key for 1 minute 5 seconds: ... Carp::ret_backtrace(/System/Library/Perl/5.28/Carp.pm:625): 625: return $mess; DB<1> Signal SEGV at /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm line 23. require List/Util.pm called at /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/Scalar/Util.pm line 23 require Scalar/Util.pm called at (eval 29)[/System/Library/Perl/5.28/File/Copy.pm:18] line 1 eval ' require Scalar::Util; require overload; 1 ' called at /System/Library/Perl/5.28/File/Copy.pm line 18 require File/Copy.pm called at /Users/dpchrist/perl5/lib/perl5/ExtUtils/Manifest.pm line 6 ExtUtils::Manifest::BEGIN() called at /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm line 0 eval {...} called at /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm line 0 require ExtUtils/Manifest.pm called at /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 1040 ExtUtils::MakeMaker::check_manifest() called at /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 508 ExtUtils::MakeMaker::new("MM", MM=HASH(0x7ff6938f1150)) called at /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 77 ExtUtils::MakeMaker::WriteMakefile("NAME", "MacOS::Foo", "VERSION_FROM", "lib/MacOS/Foo.pm", "PREREQ_PM", HASH(0x7ff694018848), "ABSTRACT_FROM", "lib/MacOS/Foo.pm", ...) called at Makefile.PL line 5 Abort trap: 6 So, it blows up when Carp::ret_backtrace tries to return. I don't know what to do with that... I initially discovered this when I attempted to build my code. I did the h2xs(1) to see if it was Perl or my Makefile.PL. ExtUtils::MakeMaker is fundamental to Perl. If that's broke, Perl is broke AFAIC. Next idea -- blow away ~/perl5 (created by local::lib), log out, log in, and try again: 2021-02-11 22:16:30 dpchrist at MacBook-Pro ~/MacOS-Foo $ cd 2021-02-11 22:19:01 dpchrist at MacBook-Pro ~ $ rm -rf perl5 2021-02-11 22:19:16 dpchrist at MacBook-Pro ~ $ exit logout Connection to dpchrist-mbp closed. 2021-02-11 22:27:17 dpchrist at tinkywinky ~ $ ssh dpchrist-mbp Last login: Thu Feb 11 22:20:29 2021 from 192.168.5.74 Attempting to create directory /Users/dpchrist/perl5 -bash: /Users/dpchrist/perl5/perlbrew/etc/bashrc: No such file or directory The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. 2021-02-11 22:27:21 dpchrist at MacBook-Pro ~ $ cd MacOS-Foo/ 2021-02-11 22:27:24 dpchrist at MacBook-Pro ~/MacOS-Foo $ make realclean 2021-02-11 22:27:26 dpchrist at MacBook-Pro ~/MacOS-Foo $ perl Makefile.PL Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for MacOS::Foo Writing MYMETA.yml and MYMETA.json So, it was something in ~/perl5. Now I need to reinstall CPAN modules required to build my code. We'll see if I run into the module that breaks ExtUtils::MakeMaker... David From not.com at gmail.com Fri Feb 12 10:13:34 2021 From: not.com at gmail.com (yary) Date: Fri, 12 Feb 2021 13:13:34 -0500 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: For what it's worth, after updating to Big Sur, I also updated the Xcode command-line tools, then used perlbrew to install Perl 5.32 in my home directory, with all new modules too. The system perl in MacOS /usr/bin went from 5.18 to 5.28, will make a difference if your local::lib was compiled against that. -y On Fri, Feb 12, 2021 at 1:40 AM David Christensen wrote: > On 2021-02-11 21:51, Joseph Brenner wrote: > > > On 2/11/21, David Christensen wrote: > > >> 2021-02-11 20:21:48 dpchrist at MacBook-Pro ~/MacOS-Foo $ perl > >> Makefile.PL Checking if your kit is complete... Segmentation fault: > >> 11 > > > That sounds pretty crazy... > > > > Are familiar with the perl debugger? You could try running with > > "perl -d", then single stepping ("n" or maybe "s") repeatedly to > > narrow down where it's segfaulting. > > > > A random thought: you could try initializing the module differently, > > rather than using h2xs. Or try basing it on something besides > > ExtUtils::Makemaker? > > Thanks for the ideas. :-) > > > Using the Perl debugger, entering 's', and then leaning on the > key for 1 minute 5 seconds: > > ... > Carp::ret_backtrace(/System/Library/Perl/5.28/Carp.pm:625): > 625: return $mess; > DB<1> > Signal SEGV at > /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm > line 23. > require List/Util.pm called at > /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/Scalar/Util.pm > line > 23 > require Scalar/Util.pm called at (eval > 29)[/System/Library/Perl/5.28/File/Copy.pm:18] line 1 > eval ' require Scalar::Util; require overload; 1 ' called at > /System/Library/Perl/5.28/File/Copy.pm line 18 > require File/Copy.pm called at > /Users/dpchrist/perl5/lib/perl5/ExtUtils/Manifest.pm line 6 > ExtUtils::Manifest::BEGIN() called at > /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm > line 0 > eval {...} called at > /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm > line 0 > require ExtUtils/Manifest.pm called at > /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 1040 > ExtUtils::MakeMaker::check_manifest() called at > /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 508 > ExtUtils::MakeMaker::new("MM", MM=HASH(0x7ff6938f1150)) called at > /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 77 > ExtUtils::MakeMaker::WriteMakefile("NAME", "MacOS::Foo", > "VERSION_FROM", "lib/MacOS/Foo.pm", "PREREQ_PM", HASH(0x7ff694018848), > "ABSTRACT_FROM", "lib/MacOS/Foo.pm", ...) called at Makefile.PL line 5 > Abort trap: 6 > > > So, it blows up when Carp::ret_backtrace tries to return. I don't know > what to do with that... > > > I initially discovered this when I attempted to build my code. I did > the h2xs(1) to see if it was Perl or my Makefile.PL. > > > ExtUtils::MakeMaker is fundamental to Perl. If that's broke, Perl is > broke AFAIC. > > > Next idea -- blow away ~/perl5 (created by local::lib), log out, log in, > and try again: > > 2021-02-11 22:16:30 dpchrist at MacBook-Pro ~/MacOS-Foo > $ cd > > 2021-02-11 22:19:01 dpchrist at MacBook-Pro ~ > $ rm -rf perl5 > > 2021-02-11 22:19:16 dpchrist at MacBook-Pro ~ > $ exit > logout > Connection to dpchrist-mbp closed. > > 2021-02-11 22:27:17 dpchrist at tinkywinky ~ > $ ssh dpchrist-mbp > Last login: Thu Feb 11 22:20:29 2021 from 192.168.5.74 > Attempting to create directory /Users/dpchrist/perl5 > -bash: /Users/dpchrist/perl5/perlbrew/etc/bashrc: No such file or directory > > The default interactive shell is now zsh. > To update your account to use zsh, please run `chsh -s /bin/zsh`. > For more details, please visit https://support.apple.com/kb/HT208050. > > 2021-02-11 22:27:21 dpchrist at MacBook-Pro ~ > $ cd MacOS-Foo/ > > 2021-02-11 22:27:24 dpchrist at MacBook-Pro ~/MacOS-Foo > $ make realclean > > 2021-02-11 22:27:26 dpchrist at MacBook-Pro ~/MacOS-Foo > $ perl Makefile.PL > Checking if your kit is complete... > Looks good > Generating a Unix-style Makefile > Writing Makefile for MacOS::Foo > Writing MYMETA.yml and MYMETA.json > > > So, it was something in ~/perl5. > > > Now I need to reinstall CPAN modules required to build my code. We'll > see if I run into the module that breaks ExtUtils::MakeMaker... > > > David > _______________________________________________ > 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 wjm1 at caa.columbia.edu Fri Feb 12 10:45:23 2021 From: wjm1 at caa.columbia.edu (William Michels) Date: Fri, 12 Feb 2021 10:45:23 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: Hi David, Chiming in only because you and I have MBPs of similar (identical?) vintage. I've been recently playing with a module and had to update CPAN. I ran into problems installing the 2 Mac-specific modules File::HomeDir and Mac::SystemDirectory , so maybe you can check if they're up-to-date for you. #CPAN output: Failed during this command: ETHER/Mac-SystemDirectory-0.13.tar.gz : make NO REHSACK/File-HomeDir-1.006.tar.gz : make_test NO one dependency not OK (Mac::SystemDirectory) ANDK/CPAN-2.28.tar.gz : make_test NO one dependency not OK (File::HomeDir) Possible "Big Sur" connection/resolution here: https://tex.stackexchange.com/questions/576232/latexindent-trouble-installing-filehomedir-macsystemdirectory-since-macos HTH, Bill. W. Michels, Ph.D. On Fri, Feb 12, 2021 at 10:14 AM yary wrote: > For what it's worth, after updating to Big Sur, I also updated the Xcode > command-line tools, then used perlbrew to install Perl 5.32 in my home > directory, with all new modules too. > > The system perl in MacOS /usr/bin went from 5.18 to 5.28, will make a > difference if your local::lib was compiled against that. > > -y > > > On Fri, Feb 12, 2021 at 1:40 AM David Christensen < > dpchrist at holgerdanske.com> wrote: > >> On 2021-02-11 21:51, Joseph Brenner wrote: >> >> > On 2/11/21, David Christensen wrote: >> >> >> 2021-02-11 20:21:48 dpchrist at MacBook-Pro ~/MacOS-Foo $ perl >> >> Makefile.PL Checking if your kit is complete... Segmentation fault: >> >> 11 >> >> > That sounds pretty crazy... >> > >> > Are familiar with the perl debugger? You could try running with >> > "perl -d", then single stepping ("n" or maybe "s") repeatedly to >> > narrow down where it's segfaulting. >> > >> > A random thought: you could try initializing the module differently, >> > rather than using h2xs. Or try basing it on something besides >> > ExtUtils::Makemaker? >> >> Thanks for the ideas. :-) >> >> >> Using the Perl debugger, entering 's', and then leaning on the >> key for 1 minute 5 seconds: >> >> ... >> Carp::ret_backtrace(/System/Library/Perl/5.28/Carp.pm:625): >> 625: return $mess; >> DB<1> >> Signal SEGV at >> /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm >> line 23. >> require List/Util.pm called at >> /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/Scalar/Util.pm >> line >> 23 >> require Scalar/Util.pm called at (eval >> 29)[/System/Library/Perl/5.28/File/Copy.pm:18] line 1 >> eval ' require Scalar::Util; require overload; 1 ' called at >> /System/Library/Perl/5.28/File/Copy.pm line 18 >> require File/Copy.pm called at >> /Users/dpchrist/perl5/lib/perl5/ExtUtils/Manifest.pm line 6 >> ExtUtils::Manifest::BEGIN() called at >> /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm >> line 0 >> eval {...} called at >> /Users/dpchrist/perl5/lib/perl5/darwin-thread-multi-2level/List/Util.pm >> line 0 >> require ExtUtils/Manifest.pm called at >> /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 1040 >> ExtUtils::MakeMaker::check_manifest() called at >> /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 508 >> ExtUtils::MakeMaker::new("MM", MM=HASH(0x7ff6938f1150)) called at >> /Users/dpchrist/perl5/lib/perl5/ExtUtils/MakeMaker.pm line 77 >> ExtUtils::MakeMaker::WriteMakefile("NAME", "MacOS::Foo", >> "VERSION_FROM", "lib/MacOS/Foo.pm", "PREREQ_PM", HASH(0x7ff694018848), >> "ABSTRACT_FROM", "lib/MacOS/Foo.pm", ...) called at Makefile.PL line 5 >> Abort trap: 6 >> >> >> So, it blows up when Carp::ret_backtrace tries to return. I don't know >> what to do with that... >> >> >> I initially discovered this when I attempted to build my code. I did >> the h2xs(1) to see if it was Perl or my Makefile.PL. >> >> >> ExtUtils::MakeMaker is fundamental to Perl. If that's broke, Perl is >> broke AFAIC. >> >> >> Next idea -- blow away ~/perl5 (created by local::lib), log out, log in, >> and try again: >> >> 2021-02-11 22:16:30 dpchrist at MacBook-Pro ~/MacOS-Foo >> $ cd >> >> 2021-02-11 22:19:01 dpchrist at MacBook-Pro ~ >> $ rm -rf perl5 >> >> 2021-02-11 22:19:16 dpchrist at MacBook-Pro ~ >> $ exit >> logout >> Connection to dpchrist-mbp closed. >> >> 2021-02-11 22:27:17 dpchrist at tinkywinky ~ >> $ ssh dpchrist-mbp >> Last login: Thu Feb 11 22:20:29 2021 from 192.168.5.74 >> Attempting to create directory /Users/dpchrist/perl5 >> -bash: /Users/dpchrist/perl5/perlbrew/etc/bashrc: No such file or >> directory >> >> The default interactive shell is now zsh. >> To update your account to use zsh, please run `chsh -s /bin/zsh`. >> For more details, please visit https://support.apple.com/kb/HT208050. >> >> 2021-02-11 22:27:21 dpchrist at MacBook-Pro ~ >> $ cd MacOS-Foo/ >> >> 2021-02-11 22:27:24 dpchrist at MacBook-Pro ~/MacOS-Foo >> $ make realclean >> >> 2021-02-11 22:27:26 dpchrist at MacBook-Pro ~/MacOS-Foo >> $ perl Makefile.PL >> Checking if your kit is complete... >> Looks good >> Generating a Unix-style Makefile >> Writing Makefile for MacOS::Foo >> Writing MYMETA.yml and MYMETA.json >> >> >> So, it was something in ~/perl5. >> >> >> Now I need to reinstall CPAN modules required to build my code. We'll >> see if I run into the module that breaks ExtUtils::MakeMaker... >> >> >> David >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> https://mail.pm.org/mailman/listinfo/sanfrancisco-pm >> > _______________________________________________ > 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 doomvox at gmail.com Fri Feb 12 12:09:15 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Fri, 12 Feb 2021 12:09:15 -0800 Subject: [sf-perl] Avengers Social tomorrow (saturday)? Message-ID: Maybe an Avengers Social club tomorrow? Tonight's possible too, but Raven and I are about to run out for a while, and it might be crowding things a little. From dpchrist at holgerdanske.com Fri Feb 12 12:29:03 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Fri, 12 Feb 2021 12:29:03 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: <75260584-b0c4-7062-ebbc-5cba62ef1390@holgerdanske.com> On 2021-02-12 10:13, yary wrote: > For what it's worth, after updating to Big Sur, I also updated the Xcode > command-line tools, then used perlbrew to install Perl 5.32 in my home > directory, with all new modules too. > > The system perl in MacOS /usr/bin went from 5.18 to 5.28, will make a > difference if your local::lib was compiled against that. I also have Xcode, and have updated it. I do not use perlbrew. AIUI local::lib is pure Perl (?) -- I do not see anything compiled: 2021-02-12 12:27:26 dpchrist at MacBook-Pro ~ $ find .cpan/build/local-lib-2.000024-* -iname xs 2021-02-12 12:27:33 dpchrist at MacBook-Pro ~ $ find .cpan/build/local-lib-2.000024-* -iname so David From dpchrist at holgerdanske.com Fri Feb 12 13:47:43 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Fri, 12 Feb 2021 13:47:43 -0800 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: References: Message-ID: <1b35e934-60e7-3f6e-2fda-b37a5b537bec@holgerdanske.com> On 2021-02-12 10:45, William Michels wrote: > Hi David, > > Chiming in only because you and I have MBPs of similar (identical?) > vintage. I've been recently playing with a module and had to update > CPAN. I ran into problems installing the 2 Mac-specific modules > File::HomeDir and Mac::SystemDirectory , so maybe you can check if > they're up-to-date for you. > > #CPAN output: > Failed during this command: > ETHER/Mac-SystemDirectory-0.13.tar.gz : make NO > REHSACK/File-HomeDir-1.006.tar.gz : make_test NO one dependency > not OK (Mac::SystemDirectory) > ANDK/CPAN-2.28.tar.gz : make_test NO one dependency > not OK (File::HomeDir) > > > Possible "Big Sur" connection/resolution here: > > https://tex.stackexchange.com/questions/576232/latexindent-trouble-installing-filehomedir-macsystemdirectory-since-macos I am also running into the EXTERN.h issue: 2021-02-11 22:57:47 dpchrist at MacBook-Pro ~ $ cpan List::AllUtils ... Configuring D/DR/DROLSKY/List-SomeUtils-0.58.tar.gz with Makefile.PL HASCOMPILERlSmZ/TESTv6X3.c:2:10: fatal error: 'EXTERN.h' file not found #include "EXTERN.h" ^~~~~~~~~~ 1 error generated. Couldn't execute cc -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Os "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -c HASCOMPILERlSmZ/TESTv6X3.c -o HASCOMPILERlSmZ/TESTv6X3.o: Inappropriate ioctl for device at Makefile.PL line 107. I saw this same issue ~20 months ago. I filed a bug report with Apple developer. They told me "this issue behaves as intended ...", and directed me to install a macOS SDK headers package that was included with Xcode. Looking at my current installation, I do not see an analogous file. stackexchange/ stackoverflow user-to-user work-arounds are not appealing, but I'll keep that in mind as a last resort. David From dpchrist at holgerdanske.com Fri Feb 12 13:55:23 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Fri, 12 Feb 2021 13:55:23 -0800 Subject: [sf-perl] Avengers Social tomorrow (saturday)? In-Reply-To: References: Message-ID: <7baadde7-c8f7-44ee-e10c-441beb386995@holgerdanske.com> On 2021-02-12 12:09, Joseph Brenner wrote: > Maybe an Avengers Social club tomorrow? Tonight's possible too, but > Raven and I are about to run out for a while, and it might be crowding > things a little. Do you mean the 2017 South Korean television series (?): https://en.wikipedia.org/wiki/Avengers_Social_Club David From not.com at gmail.com Fri Feb 12 14:09:57 2021 From: not.com at gmail.com (yary) Date: Fri, 12 Feb 2021 17:09:57 -0500 Subject: [sf-perl] macOS 11.2.1 Perl 5.28.2 ExtUtils::MakeMaker 7.34 'perl Makefile.PL' Segmentation fault: 11 In-Reply-To: <1b35e934-60e7-3f6e-2fda-b37a5b537bec@holgerdanske.com> References: <1b35e934-60e7-3f6e-2fda-b37a5b537bec@holgerdanske.com> Message-ID: Even though local::lib is pure Perl, it can compile & locally install modules that aren't pure perl. And you're using the system perl. So all non-pure-Perl modules that local::lib installed with Perl 5.18 in MacOS X will likely break in Perl 5.28 MacOS 11 (or be missing- if I recall correctly there are subdirectories with the Perl version number in it for XS modules, though I'm fuzzy on that) Issues with upgrading the OS is why I prefer using perlbrew, it lets me independently upgrade/switch OS and Perl without them stepping on each other. local::lib is a decent first step, though I ended up removing the local::lib boilerplate from my shell ".profile" login script when I switched to perlbrew, it was better to let perlbrew have cpan/cpanm install in its directory scheme. -y On Fri, Feb 12, 2021 at 4:48 PM David Christensen wrote: > On 2021-02-12 10:45, William Michels wrote: > > Hi David, > > > > Chiming in only because you and I have MBPs of similar (identical?) > > vintage. I've been recently playing with a module and had to update > > CPAN. I ran into problems installing the 2 Mac-specific modules > > File::HomeDir and Mac::SystemDirectory , so maybe you can check if > > they're up-to-date for you. > > > > #CPAN output: > > Failed during this command: > > ETHER/Mac-SystemDirectory-0.13.tar.gz : make NO > > REHSACK/File-HomeDir-1.006.tar.gz : make_test NO one > dependency > > not OK (Mac::SystemDirectory) > > ANDK/CPAN-2.28.tar.gz : make_test NO one > dependency > > not OK (File::HomeDir) > > > > > > Possible "Big Sur" connection/resolution here: > > > > > https://tex.stackexchange.com/questions/576232/latexindent-trouble-installing-filehomedir-macsystemdirectory-since-macos > > > I am also running into the EXTERN.h issue: > > 2021-02-11 22:57:47 dpchrist at MacBook-Pro ~ > $ cpan List::AllUtils > ... > Configuring D/DR/DROLSKY/List-SomeUtils-0.58.tar.gz with Makefile.PL > HASCOMPILERlSmZ/TESTv6X3.c:2:10: fatal error: 'EXTERN.h' file not found > #include "EXTERN.h" > ^~~~~~~~~~ > 1 error generated. > Couldn't execute cc -g -pipe -fno-strict-aliasing > -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Os > "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -c > HASCOMPILERlSmZ/TESTv6X3.c -o HASCOMPILERlSmZ/TESTv6X3.o: Inappropriate > ioctl for device at Makefile.PL line 107. > > > I saw this same issue ~20 months ago. I filed a bug report with Apple > developer. They told me "this issue behaves as intended ...", and > directed me to install a macOS SDK headers package that was included > with Xcode. Looking at my current installation, I do not see an > analogous file. > > > stackexchange/ stackoverflow user-to-user work-arounds are not > appealing, but I'll keep that in mind as a last resort. > > > David > _______________________________________________ > 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 doomvox at gmail.com Fri Feb 12 18:19:12 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Fri, 12 Feb 2021 18:19:12 -0800 Subject: [sf-perl] Avengers Social tomorrow (saturday)? In-Reply-To: <7baadde7-c8f7-44ee-e10c-441beb386995@holgerdanske.com> References: <7baadde7-c8f7-44ee-e10c-441beb386995@holgerdanske.com> Message-ID: Correct, and that was actually sent to the wrong address. If anyone else is interested in seeing the Avengers Social Club some time, it might be arranged, but I should probably assemble our backyard propane heater and get a video projector for the occasion. On 2/12/21, David Christensen wrote: > On 2021-02-12 12:09, Joseph Brenner wrote: >> Maybe an Avengers Social club tomorrow? Tonight's possible too, but >> Raven and I are about to run out for a while, and it might be crowding >> things a little. > > Do you mean the 2017 South Korean television series (?): > > https://en.wikipedia.org/wiki/Avengers_Social_Club > > > David > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > https://mail.pm.org/mailman/listinfo/sanfrancisco-pm > From doomvox at gmail.com Wed Feb 17 23:18:08 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Wed, 17 Feb 2021 23:18:08 -0800 Subject: [sf-perl] The SF Perl Raku Study Group, 02/21 at 1pm PDT Message-ID: Christopher Marlowe, "Doctor Faustus" (~1588): "Learned Faustus, To know the secrets of astronomy Graven in the book of Jove's high-firmanent, Did mount himself to scale Olympus' top. Being seated in a chariot burning bright Drawn by the strength of yoked dragons necks He views the clouds, the planets, and the stars, The tropic zones and quarters of the sky" The Raku Study Group February 21, 2021 1pm in California, 9pm in the UK Zoom meeting link: https://us02web.zoom.us/j/82011558402?pwd=M2pjT3kxci9MRGpVRy84MWZGd3ROUT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/276435097/ From dpchrist at holgerdanske.com Sun Feb 21 17:00:28 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Sun, 21 Feb 2021 17:00:28 -0800 Subject: [sf-perl] FreeBSD 12.2 lang/perl5-5.32.1_1 experimental 'isa' infix operator breaks UNIVERSAL::ISA Message-ID: <1f76d6d1-4e25-750f-0132-7ac2849683bb@holgerdanske.com> San Francisco PM: I have some FreeBSD servers similar to this: 2021-02-21 16:31:35 dpchrist at f3 ~/sandbox/perl/p5p $ freebsd-version ; uname -a ; pkg info perl5 12.2-RELEASE-p3 FreeBSD f3.tracy.holgerdanske.com 12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 GENERIC amd64 perl5-5.32.1_1 Name : perl5 Version : 5.32.1_1 Installed on : Wed Feb 17 19:51:04 2021 PST Origin : lang/perl5.32 Architecture : FreeBSD:12:amd64 Prefix : /usr/local Categories : devel perl5 lang Licenses : GPLv1+, ART10 Maintainer : mat at FreeBSD.org WWW : https://www.perl.org/ Comment : Practical Extraction and Report Language Options : DEBUG : off DOT_INC : off DTRACE : on GDBM : off MULTIPLICITY : on PERL_64BITINT : on PERL_MALLOC : off SITECUSTOMIZE : off THREADS : on Shared Libs provided: libperl.so.5.32 Annotations : FreeBSD_version: 1202000 cpe : cpe:2.3:a:perl:perl:5.32.1:::::freebsd12:x64:1 repo_type : binary repository : FreeBSD Flat size : 59.1MiB Description : Perl is a language that combines some of the features of C, sed, awk and shell. See the manual page for more hype. There are also many books published by O'Reilly & Assoc. See pod/perlbook.pod for more information. WWW: https://www.perl.org/ 'perldoc UNIVERSAL' states: ... When used as an instance or class method ("$obj->isa( TYPE )"), "isa" returns true if $obj is blessed into package "TYPE" or inherits from package "TYPE". ... The following script verifies the above (plus some other features): 2021-02-21 16:32:04 dpchrist at f3 ~/sandbox/perl/p5p $ cat nobug.t # $Id: nobug.t,v 1.2 2021/02/22 00:31:34 dpchrist Exp $ use strict; use warnings; use Scalar::Util qw( reftype ); use Test::More; my $aref = [ 1, 2, 3 ]; my $aobj = bless [ 5, 6, 7 ], "MyArray::Class"; is ref($aref), 'ARRAY', 'line ' . __LINE__; is reftype($aref), 'ARRAY', 'line ' . __LINE__; is UNIVERSAL::isa($aref, 'ARRAY'), 1, 'line ' . __LINE__; is eval q{ $aref->isa('ARRAY') }, undef, 'line ' . __LINE__; note sprintf "line %i: %s", __LINE__, $@; isnt $@, '', 'line ' . __LINE__; is ref($aobj), 'MyArray::Class', 'line ' . __LINE__; is UNIVERSAL::isa($aobj, 'MyArray::Class'), 1, 'line ' . __LINE__; is eval q{ $aobj->isa('MyArray::Class') }, 1, 'line ' . __LINE__; is $@, '', 'line ' . __LINE__; is reftype($aobj), 'ARRAY', 'line ' . __LINE__; is UNIVERSAL::isa($aobj, 'ARRAY'), 1, 'line ' . __LINE__; is eval q{ $aobj->isa('ARRAY') }, 1, 'line ' . __LINE__; is $@, '', 'line ' . __LINE__; done_testing; 2021-02-21 16:32:25 dpchrist at f3 ~/sandbox/perl/p5p $ perl nobug.t ok 1 - line 12 ok 2 - line 13 ok 3 - line 14 ok 4 - line 15 # line 16: Can't call method "isa" on unblessed reference at (eval 11) line 1. ok 5 - line 17 ok 6 - line 19 ok 7 - line 20 ok 8 - line 21 ok 9 - line 22 ok 10 - line 24 ok 11 - line 25 ok 12 - line 26 ok 13 - line 27 1..13 We have been discussing the experimental 'isa' binary infix operator on the Perl 5 Porters mailing list: Ref: https://www.nntp.perl.org/group/perl.perl5.porters/2021/02/msg259150.html The 'isa' binary infix operator has been incorporated into Perl 5.32.1 as an experimental feature. When enabled, it seems to break UNIVERSAL::isa called as an instance method: 2021-02-21 16:32:27 dpchrist at f3 ~/sandbox/perl/p5p $ cat bug.t # $Id: bug.t,v 1.1 2021/02/22 00:28:16 dpchrist Exp $ use strict; use warnings; use Scalar::Util qw( reftype ); use Test::More; my $aref = [ 1, 2, 3 ]; my $aobj = bless [ 5, 6, 7 ], "MyArray::Class"; SKIP: { skip 'Requires Perl version 5.32.0 or newer', 3 unless 5.032000 < $]; eval q{ use experimental 'isa'; #use feature 'isa'; # isa is experimental at (eval 8) line 5. # isa is experimental at (eval 8) line 7. # isa is experimental at (eval 8) line 11. is(($aref isa ARRAY), '', 'line ' . __LINE__); is(($aobj isa MyArray::Class), 1, 'line ' . __LINE__); is(($aobj isa ARRAY), 1, 'line ' . __LINE__); }; note $@ if $@; } is ref($aref), 'ARRAY', 'line ' . __LINE__; is reftype($aref), 'ARRAY', 'line ' . __LINE__; is UNIVERSAL::isa($aref, 'ARRAY'), 1, 'line ' . __LINE__; is eval q{ $aref->isa('ARRAY') }, undef, 'line ' . __LINE__; note sprintf "line %i: %s", __LINE__, $@; isnt $@, '', 'line ' . __LINE__; is ref($aobj), 'MyArray::Class', 'line ' . __LINE__; is UNIVERSAL::isa($aobj, 'MyArray::Class'), 1, 'line ' . __LINE__; is eval q{ $aobj->isa('MyArray::Class') }, 1, 'line ' . __LINE__; is $@, '', 'line ' . __LINE__; is reftype($aobj), 'ARRAY', 'line ' . __LINE__; is UNIVERSAL::isa($aobj, 'ARRAY'), 1, 'line ' . __LINE__; is eval q{ $aobj->isa('ARRAY') }, 1, 'line ' . __LINE__; is $@, '', 'line ' . __LINE__; done_testing; 2021-02-21 16:32:30 dpchrist at f3 ~/sandbox/perl/p5p $ perl bug.t ok 1 - line 8 ok 2 - line 10 ok 3 - line 12 ok 4 - line 32 ok 5 - line 33 ok 6 - line 34 ok 7 - line 35 # line 36: Can't call method "isa" on unblessed reference at (eval 15) line 1. ok 8 - line 37 ok 9 - line 39 ok 10 - line 40 not ok 11 - line 41 # Failed test 'line 41' # at bug.t line 41. # got: undef # expected: '1' not ok 12 - line 42 # Failed test 'line 42' # at bug.t line 42. # got: 'Can't locate object method "isa" via package "MyArray::Class" at (eval 19) line 1. # ' # expected: '' ok 13 - line 44 ok 14 - line 45 not ok 15 - line 46 # Failed test 'line 46' # at bug.t line 46. # got: undef # expected: '1' not ok 16 - line 47 # Failed test 'line 47' # at bug.t line 47. # got: 'Can't locate object method "isa" via package "MyArray::Class" at (eval 23) line 1. # ' # expected: '' 1..16 # Looks like you failed 4 tests of 16. Suggestions? David From dpchrist at holgerdanske.com Mon Feb 22 21:05:09 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Mon, 22 Feb 2021 21:05:09 -0800 Subject: [sf-perl] FreeBSD 12.2 lang/perl5-5.32.1_1 experimental 'isa' infix operator breaks UNIVERSAL::ISA In-Reply-To: <1f76d6d1-4e25-750f-0132-7ac2849683bb@holgerdanske.com> References: <1f76d6d1-4e25-750f-0132-7ac2849683bb@holgerdanske.com> Message-ID: <3c09952d-6fae-eb0b-2887-8fac4a528236@holgerdanske.com> On 2021-02-21 17:00, David Christensen wrote: > The 'isa' binary infix operator has been incorporated into Perl 5.32.1 > as an experimental feature.? When enabled, it seems to break > UNIVERSAL::isa called as an instance method: > > 2021-02-21 16:32:27 dpchrist at f3 ~/sandbox/perl/p5p > $ cat bug.t > # $Id: bug.t,v 1.1 2021/02/22 00:28:16 dpchrist Exp $ > > use strict; > use warnings; > use Scalar::Util??? qw( reftype ); > use Test::More; > > my $aref = [ 1, 2, 3 ]; > > my $aobj = bless [ 5, 6, 7 ], "MyArray::Class"; > > SKIP: { > ??? skip 'Requires Perl version 5.32.0 or newer', 3 > ????unless 5.032000 < $]; > > ??? eval q{ > ??????? use experimental 'isa'; > ??????? #use feature 'isa'; > ????# isa is experimental at (eval 8) line 5. > ????# isa is experimental at (eval 8) line 7. > ????# isa is experimental at (eval 8) line 11. > > ????is(($aref isa ARRAY), '', 'line ' .? __LINE__); > > ????is(($aobj isa MyArray::Class), 1, 'line ' . __LINE__); > > ????is(($aobj isa ARRAY), 1, 'line ' . __LINE__); > ??? }; > ??? note $@ if $@; > } > > is ref($aref), 'ARRAY', 'line ' . __LINE__; > is reftype($aref), 'ARRAY', 'line ' . __LINE__; > is UNIVERSAL::isa($aref, 'ARRAY'), 1, 'line ' . __LINE__; > is eval q{ $aref->isa('ARRAY') }, undef, 'line ' . __LINE__; > note sprintf "line %i: %s", __LINE__, $@; > isnt $@, '', 'line ' . __LINE__; > > is ref($aobj), 'MyArray::Class', 'line ' . __LINE__; > is UNIVERSAL::isa($aobj, 'MyArray::Class'), 1, 'line ' . __LINE__; > is eval q{ $aobj->isa('MyArray::Class') }, 1, 'line ' . __LINE__; > is $@, '', 'line ' . __LINE__; > > is reftype($aobj), 'ARRAY', 'line ' . __LINE__; > is UNIVERSAL::isa($aobj, 'ARRAY'), 1, 'line ' . __LINE__; > is eval q{ $aobj->isa('ARRAY') }, 1, 'line ' . __LINE__; > is $@, '', 'line ' . __LINE__; > > done_testing; Can anyone confirm that this script fails on Perl 5.32.1? David From doomvox at gmail.com Fri Feb 26 15:44:48 2021 From: doomvox at gmail.com (Joseph Brenner) Date: Fri, 26 Feb 2021 15:44:48 -0800 Subject: [sf-perl] The SF Perl Raku Study Group, 02/28 at 1pm PDT Message-ID: The SF Perl Raku Study Group, 02/28 at 1pm PDT "With the Power of your Ancestor Grant the prayer of your followers, Arise and Show Your Power" "Mothra's Song" (1961) by Yuji Koseki The Raku Study Group. February 28th, 2021 1pm in California, 9pm in the UK Zoom meeting link: https://us02web.zoom.us/j/89426065814?pwd=ZXVKMmxBVjk3czVKTzl6WER3MTAzQT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/276615265/ From dpchrist at holgerdanske.com Sun Feb 28 17:22:33 2021 From: dpchrist at holgerdanske.com (David Christensen) Date: Sun, 28 Feb 2021 17:22:33 -0800 Subject: [sf-perl] FreeBSD 12.2 lang/perl5-5.32.1_1 experimental 'isa' infix operator breaks UNIVERSAL::ISA In-Reply-To: <3c09952d-6fae-eb0b-2887-8fac4a528236@holgerdanske.com> References: <1f76d6d1-4e25-750f-0132-7ac2849683bb@holgerdanske.com> <3c09952d-6fae-eb0b-2887-8fac4a528236@holgerdanske.com> Message-ID: <778c40f6-8cc7-cffb-159e-f8671a3f7c24@holgerdanske.com> sfpm: Regarding the experimental binary infix 'isa' introduced recently as an experimental feature and how it breaks UNIVERSAL::isa(), a shortened version of my test script follows with sample runs. Can anyone confirm the failures on Perl 5.32.0? 5.32.1? David 2021-02-28 17:20:51 dpchrist at tinkywinky ~/sandbox/perl/p5p $ cat bug.t #!perl # $Id: bug.t,v 1.6 2021/03/01 01:20:50 dpchrist Exp $ # By David Paul Christensen dpchrist at holgerdanske.com # Public Domain. # # Demonstrates bug in UNIVERSAL::isa() when experimental 'isa' # binary infix operator is enabled. Operator was introduced in Perl # 5.32.0 (?). Breakage confirmed on FreeBSD 12.2 with Perl 5.32.1. # # See discussion on Perl 5 Porters mailing list # https://www.nntp.perl.org/group/perl.perl5.porters/2021/02/msg259150.html use strict; use warnings; use Test::More; my $aobj = bless [ 5, 6, 7 ], "MyArray::Class"; SKIP: { skip 'Requires Perl version 5.32.0 or newer', 2 unless 5.032000 <= $]; eval q( use experimental 'isa'; is(($aobj isa MyArray::Class), 1, 'line ' . __LINE__); is(($aobj isa ARRAY), 1, 'line ' . __LINE__); ); } is eval q{ $aobj->isa('MyArray::Class') }, 1, 'line ' . __LINE__; is eval q{ $aobj->isa('ARRAY') }, 1, 'line ' . __LINE__; done_testing; __END__ ### sample run on Perl 5.24.1 -- UNIVERSAL::isa() works as expected 2021-02-28 17:13:39 dpchrist at tinkywinky ~/sandbox/perl/p5p $ cat /etc/debian_version ; uname -a ; perl -v | head -n 2 9.13 Linux tinkywinky 4.9.0-14-amd64 #1 SMP Debian 4.9.246-2 (2020-12-17) x86_64 GNU/Linux This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux-gnu-thread-multi 2021-02-28 17:14:13 dpchrist at tinkywinky ~/sandbox/perl/p5p $ perl bug.t ok 1 # skip Requires Perl version 5.32.0 or newer ok 2 # skip Requires Perl version 5.32.0 or newer ok 3 - line 32 ok 4 - line 34 1..4 ### sample run on Perl 5.32.1 -- UNIVERSAL::isa() broken 2021-02-28 17:10:58 dpchrist at f3 ~/sandbox/perl/p5p $ freebsd-version ; uname -a ; perl -v | head -n 2 12.2-RELEASE-p4 FreeBSD f3.tracy.holgerdanske.com 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 GENERIC amd64 This is perl 5, version 32, subversion 1 (v5.32.1) built for amd64-freebsd-thread-multi 2021-02-28 17:15:18 dpchrist at f3 ~/sandbox/perl/p5p $ perl bug.t ok 1 - line 4 ok 2 - line 6 not ok 3 - line 32 # Failed test 'line 32' # at bug.t line 32. # got: undef # expected: '1' not ok 4 - line 34 # Failed test 'line 34' # at bug.t line 34. # got: undef # expected: '1' 1..4 # Looks like you failed 2 tests of 4.