user-pic

Ben Morrow

  • Commented on A Tiny Code Quiz
    No, a list in scalar context returns its last element. It has to, that's how the 'scalar comma operator' works. What seems weird here is that the scalar context propagates down to the arrays, because we expect arrays to interpolate...
  • Commented on The grep test - my personal experience
    I assume you know that my $cop = B::svref_2object($class->can($method))->START; say for $cop->file, $cop->line; will tell you exactly where a method was declared? Ah yes, Sub::Information, of course you do... This doesn't help with finding calls, of course....
  • Commented on Perl 7
    Personally I don't much care for stupid version number games, but then I don't much care about the details of the version numbers at all, so Ovid can count me as a 'yes, if you must'. My point really was...
  • Commented on Perl 7
    I suspect Larry would be against the idea. One of the Perl 6 RFCs said something like 'Perl 6 will be the last version of Perl' and Larry's response was along the lines of 'Perl 7 will be the last...
  • Commented on The Price of Cleverness (YAML is not Safe)
    @asukrieh: If you want robust and fast YAML processing using the normal Dump/Load API, please consider switching to YAML::XS. It is by far the best Perl module for YAML at this time. It requires that you have a C compiler,...
  • Commented on The Price of Cleverness (YAML is not Safe)
    I thought YAML.pm basically was a proof-of-concept, and the production implementation was YAML::XS. Certainly I've had problems in the past which were fixed by switching; I would never choose to use YAML in production code....
  • Commented on Skipping Test::Class tests in abstract base classes
    Would it be possible/worth it to simplify the interface further to a :Concrete attribute, so you could just write sub duration : Tests(2) Concrete { my $test = shift; my $instance = $test->get_instance; can_ok $instance, 'get_duration'; my $duration = $instance->get_duration;...
  • Commented on Test::Most and timeit()
    use Benchmark ":hireswallclock"; But it probably ought to be the default, rather than hidden behind an obscure option. (Not to mention the implementation, which is… interesting.)...
  • Commented on Moose and Fatal Type Constraints
    To my mind this is an obvious case where you need Perl 6-ish exceptions which are handled before unwinding the stack, and can thus 'un-throw' themselves (that is, resume execution from the point where the exception was thrown, rather than...
  • Commented on Convert FLAC to MP3 on OS X for iTunes
    I would use AAC rather than MP3, nowadays; and you can do without the uncompressed temporaries: flac -dc $flac | faac -wo ${flac%.flac}.mp4 - (iTunes/OSX may or may not prefer .m4a to .mp4). If you've got the information available some...
  • Commented on Role::Basic tweaks and the future
    This makes me suspicious that I shouldn't trust B modules prior to 5.8.x? Can anyone confirm this? B works fine on 5.6, or, at least, your use of it is fine. The problem is here: sub _load_role { my...
  • Commented on Why Does Apple Use launchd?
    What I want to know is why on Earth Apple abandoned the old NeXTStep JSON-like plist format in favour of XML. The old format was just as well-documented as XML (hah!), and a good deal easier for both humans and...
  • Commented on Pre-Commit Hooks and Breaking the Build
    [ $lines > 0 ] does a string compare. You probably want -gt instead. Also, I would always use $() rather than backticks, and you don't need to quote the "-u" under 'diff' (though you would if you had more...
  • Commented on One Thing I Love About Git
    @Aristotle: Oh, I agree. I'm talking more about the small changes needed to make something compile, or about splitting a file in two without losing history for either copy....
  • Commented on Custom Hacks and Comfort Levels
    Don't try to parse the SQL in Perl, just feed it to psql. IIRC DBD::Pg will let you feed lots of ;-separated statements to $dbh->do, too, so there's really no need to mess around splitting them up (wrong)....
  • Commented on One Thing I Love About Git
    It's important to realise that, unlike svn, git doesn't even store renames in the repository. It doesn't version files, it versions whole trees, and any 'find me the last revision to change this file' logic is heuristic, based on similarity....
  • Commented on Miscellaneous Thoughts
    This is just the same as { my $x; sub foo { $x } } where &foo has a ref to $x even after its name has gone out of scope. (How do I post code snippets without double-spacing like...
Subscribe to feed Recent Actions from Ben Morrow

  • Aristotle commented on Perl 7

    Yes Jenda, these clearly look like dead projects to me. You’re talking out of your ass. As for your opinion that this supposed failure of the effort entitles you to give the people who are working on it a public “fuck you”, how about a nice big cup of shut-the-hell-up.

    Thank you.

  • Aristotle commented on The grep test - my personal experience

    (This is where Smalltalk’s “it’s all a live image” approach has the upper hand: metaprogramming doesn’t hide things from you, because generated methods show up in the code browser just like any hand-written method would.)

  • Ether commented on The grep test - my personal experience

    I actually do have some code up on the cpan that is automatically generated from a template at build time... I've been meaning to make the templating a little more usable, so thanks for the reminder. :)

  • :m) commented on A Tiny Code Quiz

    ..And why does the comma operator behave like this?

    The Camel Book mentions "This is just like C's comma operator."

    I have not thought about it enough, but the current behaviour does not seem intuitive, and therefore seems to violate the famous principle of least astonishment (for me). Ha! :-)

    But as chris says, it is probably my duty not to be astonished.. ;-)

  • Pradeep Pant commented on A Tiny Code Quiz

    My first guess was 6 which is of course not correct. Have to revisit http://perldoc.perl.org/perlop.html

Subscribe to feed Responses to Comments from Ben Morrow

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.