user-pic

gugod.org

  • Commented on ::NonOO suffix for non-OO version of a module
    I like the idea, but I'd favor doing this implicitly rather than having to time some extra stuff, for instance, implies non-oo usage use Number::Closest "find_closest_numbers"; While importing no subs implies oo usage use Number::Closest; But it'd be a bit...
  • Commented on OI::M::Finally({IO::All})
    Hmm, this should work @lines = @{ io("file.txt") }; Since in IO::All::File, @{} is overloaded to deref it as Tie::File Tested with IO::All 0.46...
Subscribe to feed Recent Actions from gugod.org

  • educated_foo commented on OI::M::Finally({IO::All})

    Good to see that Zoidberg's alive again. My zsh muscle memory was a bit too strong the last time I tried it, but it was a really nice merger of Perl and Unix the shell.

    That said, I was thinking of something that worked within Perl's syntax, e.g.

    io("file.txt") | sub { ... } | io("| frob > file2.txt");

    But "|"'s precedence is a pain, there's the question of line-at-a-time vs. whole-output, etc.

  • Toby Inkster commented on OI::M::Finally({IO::All})

    This seems to suggest that it's theoretically doable:

    perl -e'use overload ">" => sub { use Data::Dumper; print Dumper \@_ }; my @a; my $o = bless []; $o > \@a'

    The overload sub clearly gets passed an arrayref; the arrayref doesn't get numified first or anything annoying like that.

    Someone just needs to make a few adjustments to the following IO::All methods to detect when the scalar is an arrayref and DWIM.

    • overload_any_to_scalar
    • overload_any_addto_scalar
    • overload_scalar_addto_any
    • overload_scalar_to_any
  • Joel Berger commented on OI::M::Finally({IO::All})

    It was never very broken. There was a test failure that got introduced by some esoteric change between 5.8 and 5.10. I fixed that, one other rare bug and simplified the build process. Jaap gave me co-maint and there you go!

  • Steven Haryanto commented on OI::M::Finally({IO::All})

    Hi gugod, you're right it does work, but: 1) it turns on chomping by default; 2) it needs rw access. This fails if you're not root, for example: @lines = @{ io("/etc/passwd") };

  • Steven Haryanto commented on ::NonOO suffix for non-OO version of a module

    Some more thoughts:

    * This differs from Alt in that Alt is about alternate implementation, while this is about alternate interface. Also, Alt-* distributions contains module with the same name as the target, so no two alternate implementation can coexist in the same installation (but that's beside the point).

    * Aside from this ::NonOO stuff, there can be various alternate interfaces. ::Simple also fits here?

    * For alternate OO implementation (e.g. original module uses Moose, one might create a Moo or Mouse version), this fi…

Subscribe to feed Responses to Comments from gugod.org

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.