user-pic

Aristotle

  • Commented on The ordering operators
    Question is why at that point you wouldn’t just write this: sub vcmp0 { my ($v1, $v2) = @_; my @v1 = split /[.]/, $v1; my @v2 = split /[.]/, $v2; $v1[0] <=> $v2[0] || $v1[1] <=> $v2[1] || $v1[2]...
  • Commented on The ordering operators
    Mpapec: Certainly a single comparison using a padded number would be simpler. Unfortunately the code has no control over the format of $version because that value comes from an API. So using a single comparison with padded numbers would require...
  • Commented on Начнём пожалуй
    Maybe because basically the entire page is in English except the post title and the one sentence of post content? Presumably that’s not enough to make Chrome guess that the substance of the page is actually in Russian. Oh, and...
  • Posted The ordering operators to Aristotle

    Perl has two operators, cmp and <=>, which are basically never seen outside of sort blocks.

    That doesn’t mean you can’t use them elsewhere, though. Certainly ="prettyprin…

  • Commented on My Favorite Modules: <code>Devel::NYTProf</code>
    Specifically what it’s counting is characters that aren’t combining marks. E.g. if you have an “é”, while it might be encoded as one single codepoint (same as in Latin-1), it might also be encoded as an “e” followed by a...
  • Posted To whom this MySQL UTF-8 news may concern to Aristotle

    Strictly speaking not news exactly, given that it dates from early 2018, but it was news to me, and since I haven’t seen it make the rounds I still find it worth disseminating. From the MySQL 8.0.11…

  • Commented on A (not so) simple matter of privacy
    I would expect the following code to work: Well, yes, obviously, a closure is a different kind of situation. The question would be what happens in a named sub declared inside a method – where I would expect the exact...
  • Commented on A (not so) simple matter of privacy
    # which fields are visible from this eval? Isn’t the answer simply “none”? It seems a trick question. Fields aren’t visible inside a sub, whether it’s lexical or not, no?...
  • Commented on My Favorite Warnings: <code>shadow</code>
    It is hard to come up with a reason why you would want to disable this warning. But it’s easy to see why you would might want to make it fatal without also making everything else in misc fatal –...
  • Commented on Closures
    Perl internally stores lexicals for a scope in what it calls pads (an array of variables, essentially). There is a lot of trickery going on to reuse both whole pads as well as individual entries, and generally as much of...
  • Commented on Addressing CPAN vulnerabilities related to checksums
    Yes – if authors signed their distributions themselves, this would verify the origin of the bits all the way to the source, rather than just up to PAUSE, which would be a worthwhile increase in trust. The only problem is...
  • Commented on Addressing CPAN vulnerabilities related to checksums
    If a malicious person managed to get write access to the filesystem of a trusted mirror Indeed – and I had thought of that but dismissed it: I reasoned it would require the filesystem of either of the two trusted...
  • Commented on Addressing CPAN vulnerabilities related to checksums
    If the mirror is trustworthy and so is the connection to it, does verification of the PAUSE-signed CHECKSUMS serve any remaining purpose? What threat not already covered by the use of a trustworthy origin and channel can be averted by...
  • Commented on Bash perldoc completion tweaks
    Glad it’s useful! Unfortunately I don’t seem to be able reproduce a problem by trying to create a situation similar to what you’ve described. Can you describe what happens in that circumstance in a little more detail than that it...
  • Commented on My Favorite Warnings: <code>deprecated</code>
    No word that I know of on when it will actually be removed. From the perlpolicy definition of “deprecated”: If something in the Perl core is marked as deprecated, we may remove it from the core in the future, though...
  • Commented on My Favorite Warnings: <code>redefine</code>
    I am willing to write it up, no problem. The problem I do have is I don’t know quite what the opening of such an article would look like. Here in this comment section, the choice of facts to outline...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Ah, I didn’t properly register that you were talking about named subs. Yes, named subs aren’t special in any way in this regard. The only thing that distinguishes them from unnamed subs is that they get assigned to a glob...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Correct. If you do something like my ( @getter, @setter ); for my $i ( 'a' .. 'z' ) { my $value = $i; push @getter, sub { $value }; push @setter, sub { $value = $_[0] }; } then...
  • Commented on My Favorite Warnings: <code>redefine</code>
    You seemed to be saying that sub make_adder { my ( $addend ) = @_; return sub { $_[0] + $addend }; } is an example of one closure but sub make_adder_and_setter { my ( $addend ) = @_; return...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Having to retain the value at the time the closure was created is not a requirement I have ever seen in any definition of closures. (If that was required by the definition, then Perl would not have closures, period, because...
  • Commented on My Favorite Modules: <code>if</code>
    Of course you can always make it work by sprinkling the requisite amount of BEGIN blocks all over the place, but pretty it ain’t: my ( $condition, $module ); BEGIN { $condition = some_computation(); $module = 'Some::Module'; } use if...
  • Commented on Perl Weekly Challenge 130: Odd Number and Binary Search Tree
    This does more allocations and deallocations, potentially many more, so it will be slower in a lot of cases – in most, I’d even say. The memory savings will only be significant if the list of integers is very large...
  • Commented on My Favorite Warnings: <code>redundant</code> and <code>missing</code>
    I had no idea that 'no' could take an 'if'. It’s not an actual if, it’s just a module called if. That’s why you need a comma after the condition, and why the name of the module you want to...
  • Commented on On the eve of CPAN Testers
    (There are, of course, CPAN::Reporter itself for CPAN.pm and cpanm-reporter for cpanminus, whereby you can send reports for the day-to-day module installing that you do manually. But those are missing the endless loop of a dedicated CPAN testing rig, which...
  • Commented on On the eve of CPAN Testers
    I’m not sure, Matthew. I haven’t kept up with the topic in a couple of years so I only have vague memories to go off that I’d have to refresh. One thing I found just now is CPAN::Reporter::Smoker. I seem...
  • Commented on On the eve of CPAN Testers
    So, let's get concrete. What steps are you proposing or personally taking to improve the situation? Well, the problem is twofold – people who used to contribute have walked away, and new people have not replaced them. Why have they...
  • Commented on On the eve of CPAN Testers
    I've found CPAN Testers to be extremely helpful lately in troubleshooting a new distribution that I've been working on. I always have, as well. Like I said, I never bothered with CI before – CI has always been better at...
  • Posted On the eve of CPAN Testers to Aristotle

    Have a look at the CPAN Testers reports for two TRIAL releases of the same module, one from 2 days ago, the other a little over 3 years ago:

  • Posted What they say in Java is just as true in Perl to Aristotle
    use Benchmark::Dumb 'cmpthese';
    ( $bar, $quux ) = qw( bar quux );
    
    cmpthese( 0.0002, {
      conc => q{
        my $str = "xxx ";
        (((( $str .= "foo" ).= $::bar ).= "baz" ).= $::quux ).= "qux";
      },
      intp => q{
        my $str = "xxx ";
        $str .= "foo${::bar}baz${::quu…
  • Commented on Open Letter to the Perl Foundation Board
    (Meta note: submitting from the comment preview form is now fixed, btw. That should remove one big source of confusion.)...
Subscribe to feed Recent Actions from Aristotle

  • Salvador Fandiño commented on A (not so) simple matter of privacy

    Isn’t the answer simply “none”?

    Yes, that was the conclusion: it is not a good idea to let lexical subroutines, declared at the class top level, access the object fields.

    It seems a trick question. Fields aren’t visible inside a sub, whether it’s lexical or not, no?

    Well, IMO, they should be visible if the sub is declared inside a method. For instance, I would expect the following code to work:

    use Scalar::Util qw(first);
    
    

    class A {
    field $…

  • nhorne commented on Addressing CPAN vulnerabilities related to checksums

    I have a local mirror which downloads from https://cpan.org, so it's trusted. I then mount the mirror using NFS, so the entry in MyConfig.pm for urllist starts with "file://foo/bar". Even though I know it's trusted I still get:

    Warning: checksum file '/mnt/CPAN/authors/id/G/GB/GBARR/CHECKSUMS' not conforming.

    The cksum does not contain the key 'cpan_path' for 'CPAN-DistnameInfo-0.12.tar.gz'.
    Proceed nonetheless? [no]

    How can I handle this scenario?

  • Toby Inkster commented on A (not so) simple matter of privacy
    method $do_internal () {
      ...;
    }
    

    has been supported by Zydeco for over a year. documentation.

  • Tom Wyant commented on My Favorite Modules: <code>Devel::NYTProf</code>

    Thanks. I may have known that at one point, but I certainly didn't when I was writing this, and the desultory research I did under my self-imposed submission deadline did not flush it out.

  • Yuki Kimoto commented on My Favorite Modules: <code>Devel::NYTProf</code>

    Devel::NYTProf outputs the result of beautiful coloring HTMLs.

Subscribe to feed Responses to Comments from Aristotle

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.