http://qs321.pair.com?node_id=11119051

Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:

I'm still processing what I experienced at TPC. I've had time to catch up on some of the youtube videos from the ones I missed. Sometime in all the zooming, I thought I heard one of the presenters say

that's why we eval version

I thought it was Sawyer X, who says a lot of things parenthetically, but I went over his talk for a third time and didn't hear it again. I didn't understand what he meant, so I could well have misheard it or just dreamed up the recollection wholesale.

A couple days later, I'm going through the guts of a test script for local::lib and I see this, beginning line 16 of xt/bootstrap.t

sub check_version { my ($perl, $module) = @_; my @inc = `$perl -le "print for \@INC"`; chomp @inc; (my $file = "$module.pm") =~ s{::}{/}g; ($file) = grep -e, map { "$_/$file" } @inc; return undef unless $file; my $version = MM->parse_version($file); eval $version; }

Q1) What purpose does this line serve?

 eval $version;

Q2) Is this a "string eval?"

Q3) Do dangers lurk in its use, cf. Uri Guttman's 2019 TPC talk on 'eval'?

Q4) Does anyone else remember the "that's why we eval version" comment, or is it just me?

Thanks for your comment,