user-pic

Toby Inkster

Subscribe to feed Recent Actions from Toby Inkster

  • byterock commented on The way to create Class with only Perl core language.

    This was standard early way to do things from many years ago. 1980~90s. Now days we would call it Old Shcool.

    https://www.perl.com/article/25/2013/5/20/Old-School-Object-Oriented-Perl/

    I have had to do above in so called closed systems some time ago even wrote a module(Orignal) to help me out is such situations.

    If I had to work on such a closed system today with and it had up to date perl I would go with Class::Struct as that is part of core

  • Konstantin Uvarin commented on namespace::local: hiding utility functions in moo[se] roles

    Sure, but that's not so funny!

    Also it means private functions must be above the public ones, although who cares about the order anyway...

  • ysth commented on Is there anything wrong with this benchmark?

    I believe Toby is right, and the sub created by around will not recognize any later changes to the inheritance (or redefining of the original sub), which obviously makes it more efficient - as long as you are not making such changes.

  • Grinnz commented on Is there anything wrong with this benchmark?

    With ->SUPER, your sub is being called first and then it looks up what the superclass is via inheritance. With around, it *creates a new sub* in place and then passes you (at call time) a reference to the previously existing sub, or the method that would have been inherited at the time of 'around'. You're right that later changes to inheritance would not be recognized (changing inheritance at runtime seems like a bad idea in general) but redefining the sub itself would override the 'around' completely since it already installed into that name, so that wouldn't be useful either.

  • Ivan Bessarabov commented on Site perlbanjo.com is released! Run & share Perl code in the browser.

    This system was created with security in mind.

    Every run is performed in the isolated limited sandbox that is created especially for the run and is destroyed afterwards.

    It is harmless that you can access file /etc/passwd There are no secrets in it. You can create the exact same file on you on computer with just a single line:

    docker run ubuntu:14.04.5 sh -c 'adduser --disabled-password --gecos "" larry; cat /etc/passwd'

    And you don't need tricks to access that file. You can simply enter `cat /etc/passwd` as a command.

Subscribe to feed Responses to Comments from Toby Inkster

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.