user-pic

Toby Inkster

  • Commented on Data::Dumper Debugging
    Perl warnings go to STDERR anyway, so I'm already in the habit of: perl whatever.pl |& less...
  • Posted Planet Moose - August 2014 to Toby Inkster

    Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the…

  • Commented on Data::Dumper Debugging
    Yes, I like Carp::Reply. It only kicks in when you reach an exception though. I like the idea of dropping into a REPL, poking around, exiting the REPL and resuming execution from there. Useful if you want to, say, poke...
  • Commented on Single-page POD for a distribution
    With multiple pages, you can open them in different browser tabs, or different terminals, and flick back and forth between them pretty easily. I'd actually expect the documentation to be harder to read if you were having to scroll up...
  • Commented on Data::Dumper Debugging
    Data::Printer produces nice output, and I used to use it quite a lot. I got frustrated by a couple of things though. For objects it shows a list of methods they have - awesome, right? However, it fails to show...
  • Commented on Rewriting Pod::Readme
    I've always taken the readme-from-pod route (which many people seem to do), but have recently been thinking that duplicating the information from the pod as a README file is fairly pointless. Instead a smaller README file containing the distribution's abstract,...
  • Posted Data::Dumper Debugging to Toby Inkster

    I've never really used the Perl debugger much (maybe I should learn?) and usually resort to lots of use Data::Dumper; print Dumper($somevar); statements to help me understand what's going wrong with a piece of code.

  • Commented on Link to public version control system (GitHub or otherwise)
    META.json allows two main fields for the repository - a URI for a web link, and also a VCS-specific string which often looks something like a URI. (There's a third field for the repo type - "git", "svn", "hg", etc.)...
  • Commented on Link to public version control system (GitHub or otherwise)
    The reason for the dramatic improvement you see may be a "CPAN Day" blip. Looking at the last 2000 uploads (as of now), 16% of them were uploaded by just one person - a person who happens to be quite...
  • Commented on Link to public version control system (GitHub or otherwise)
    The MetaCPAN dashboard thingy is buggy though. Mine shows dozens of distributions that it claims have no link to version control. An example is LV. This quite clearly includes a version control link in META.json and META.yml, which is clearly...
  • Commented on Introducing IOD file format
    It doesn't seem quite the same. In a traditional INI file: [section] foo=1 bar=2 bar=3 "bar" is an array, but is "foo" a simple string, or is it an array with just one element? The INI parser will probably treat...
  • Commented on Type::Tiny 1.000000 Released
    Ivan, have you read Type::Tiny::Manual::Libraries? That's probably the best starting point for creating a type library....
  • Commented on Please don't use ::Tiny unless it meets the ::Tiny criteria, thanks!
    Answering for Type::Tiny, although the distribution which it is part of is certainly not as tiny as it started out as, the Type::Tiny module itself is still pretty lean. The module itself has no non-core dependencies, and I've even tried...
  • Posted Type::Tiny Tricks #7: Tricks with Dicts to Toby Inkster

    In Perl, hashes are typically used for two sorts of purposes: maps (where the hash key acts as an object identifier) and dictionaries (where the hash key acts like a field name). A quick illustration of what I mean by this:

  • Posted Type::Tiny Tricks #6: Tricks with Tuples to Toby Inkster

    Let's say you want an attribute to accept a pair of numbers - perhaps a geographic co-ordinates [ 50.873, -0.002 ]. You could constrain the attribute as ArrayRef[Num], but that would accept an arrayref containing a single…

  • Posted Type::Tiny Tricks #5: Wrapping Moose/Mouse Type Constraints to Toby Inkster

    So you have this Moo class, and it turns out what you really need for it is the StrictVersionStr type constraint defined in…

  • Posted Type::Tiny Tricks #4: Inlined Type Constraints to Toby Inkster

    If ever you're unsure of how a type constraint has been defined, you can examine the string of Perl code used to implement it. For example, does an ArrayRef[Int] accept an empty arrayref?

  • Posted Type::Tiny Tricks #3: One-off Coercions to Toby Inkster

    Here's a quick way to create an attribute that coerces to an integer from any other number:

    ="k…
  • Commented on Type::Tiny Tricks #2: Types Are Objects
    This blog post is about Type::Tiny type constraint objects. In the Type::Tiny framework all types (Int, Str, ArrayRef, FileHandle, etc) are represented by objects. (Though that's not to say that values are.)...
  • Posted Type::Tiny Tricks #2: Types Are Objects to Toby Inkster

    When you use code like this:

    use
  • Commented on The 19th CPAN Day and the 1st
    Something I just noticed... One of those ten new CPAN contributors was Tim Vroom. Although this was his first CPAN contribution, he had previously created something else for the Perl community....
  • Posted Type::Tiny Tricks #1: Quick Intersections to Toby Inkster

    Type::Tiny objects overload the & (bitwise and) operator to build a type constraint intersection. For example:

  • Commented on CPAN Day winner?
    What that screen capture doesn't show is that for most of those distributions he didn't just make a single release. For example, Zilla-Dist-0.0.151 appears on your list because it's the latest release of Zilla-Dist, but INGY actually released Zilla-Dist-0.0.133 at...
  • Posted Type::Tiny 1.000000 Released to Toby Inkster

    It's been almost 17 months, and over 160 releases to get there, but Type-Tiny 1.000000 has been released on CPAN Day 2014.

  • Commented on Creating an MMORPG in Perl
    "Nobody doubts my coding ability, but creating a compelling game? That's a different story entirely" I played Unknown::Values a bit last year, but didn't find it to be a very immersive experience....
  • Commented on Acknowledge your contributors on CPAN Day
    Also, if you have a file called "CREDITS", "AUTHORS", or "THANKS" in your release's root directory, MetaCPAN will consider this to be an a href="https://github.com/CPAN-API/metacpan-web/blob/master/lib/MetaCPAN/Web/Model/API/Release.pm#L320">interesting file and display it on your release page (under the "Other Files" heading). search.cpan.org also...
  • Commented on Don't be afraid to rename your module / dist
    Yes, posting a comment from the "Preview" page is broken. The workaround is to preview, then hit back, (if necessary, edit it some more, preview again, and go back again... until you are satisfied with your comment), and then post...
  • Posted Planet Moose - July 2014 to Toby Inkster

    Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the…

  • Commented on Method Privacy in Perl
    That only partly solves the problem. It prevents subclasses from overriding the method when called from inside my class. It doesn't solve the wider problem of making it clear which methods are suitable for subclasses to call/override, and which methods...
  • Commented on Method Privacy in Perl
    There are perfectly valid reasons to have private methods. Say, for example, you have two different public methods that have a lot of code in common. Maybe a print_delivery_address_label() method and a print_billing_address_label() method. The common code could be factored...
Subscribe to feed Recent Actions from Toby Inkster

  • perlancar commented on Single-page POD for a distribution

    Yeah, wouldn't a long page also make you go "back and forth" (albeit vertically)?

  • Gabor Szabo commented on Single-page POD for a distribution

    Yes, well I guess the advantage might be that it will be easier to search, but then maybe it would be better to have an index of all these pages with the "important" words index. Where I think "important" would be names of functions/methods/attributes.

  • Samuel Kaufman commented on Data::Dumper Debugging

    Have you taken a look at Carp::Reply?
    I've used it to similar effect, probably worth a SEE ALSO.

  • Matt Perry commented on Data::Dumper Debugging

    Data::Printer outputs to STDERR which means you can't pipe the output to a pager without extra work. At that point Data:Dumper ends up requiring less typing.

  • smls commented on Data::Dumper Debugging

    @Toby Inkster

    You're right, Data::Printer has some quirks.
    The prototype thing is a trade-off; it allows p to treat an array variable with a single value differently than a scalar variable, and an array differently than a hash -- with the downside that you can only dump actual variables, not the results of anonymous expressions.

    Give Data::Dump a try if you want something closer to the Data::Dumper experience but with less typing and with cleaner/terser output (and in particular, no silly "$VAR1 =" noise in the output).


    @Matt Per…

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 run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.