user-pic

Steven Haryanto

  • About:

    A programmer (mostly Perl 5 nowadays).

    My CPAN ID: SHARYANTO. I'm sedusedan on perlmonks. My twitter is stevenharyanto (but I don't tweet much). Follow me on github: sharyanto.

  • Commented on Scalar::Util::looks_like_number
    BTW, it looks like maybe looks_like_number() will return canonical bool, so all this might be going away soon: https://rt.cpan.org/Ticket/Display.html?id=94805 By then we'll need Scalar::Util (or some other module) to provide things like is_nan() (or looks_like_nan(), whatever), is_inf(), is_stringy_num(), is_stringy_int(), is_stringy_float(),...
  • Commented on Gluu fer the Wëëbb Part 1
    s/.yml//g should be s/\.yml$// Otherwise, if you have a file named 'myml.txt' it will be changed to '.txt'....
  • Commented on Relief from Regexes
    ^ That would be (?<NAME>PAT) and (?P<NAME>PAT)...
  • Commented on Relief from Regexes
    BTW, I found the most usable "visual/GUI regexp debugger thingy" to be Komodo IDE's Rx toolkit. For the free alternative, I found kodos/kiki to be adequate. But you'll need to remember to write (?PAT) named captures as (?PPAT) because kodos/kiki...
  • Posted The everywhere trick to Of course I still use Perl

    After reading Eric's Plack blog series today, I also stumbled upon his other blog post about a nice little Devel::Dwarn trick.

    I also pepper ="pre…

  • Commented on Do not use each
    I've also avoided 'each' since a few years ago. Is there a Perl::Critic policy to forbid using each? There should be. And perhaps perl can emit experimental warning for usage of 'each' in version 5.2x? :-)...
  • Commented on I != SysADMIN
    Wrote a short script for you: https://github.com/sharyanto/scripts/blob/master/humanize-crontab Example usage on the command-line: % crontab -l | humanize-crontab Sample output: # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.fcL9SL/crontab installed on Tue Nov 24 17:22:22 2009)...
  • Commented on The Twelve-Factor App
    I don't think the 12-factor app guide precludes using a logger object. It just recommends to log to stdout by default, which is doable even if we use a logger object....
  • Commented on Oh Carp!
    Ah, I misread dolmen's original comment. Deleting the application's version of Carp will indeed cure the problem. Except when some other modules which are included by the application decides that it needs a recent version of Carp....
  • Commented on Precision Testing for Modern Perl
    Hopefully Test::Postmodern will not be confused as a module for testing Moose, since Moose is postmodern....
  • Posted Getting a progress report from a running program to Of course I still use Perl

    Imagine this scenario: you ran a program to do some (potentially) long-running task. The program has a --verbose or --debug command-line option to print progress report to stdout and/or log file. This time you forgot to issue the command-line option and 10 minutes into it you wonder how the…

  • Posted Trivial tools to Of course I still use Perl

    There are various trivial command-line tools which I (have had to) create because of various reasons. Below are some of them:

    norepeat

    I didn't want to write this, but couldn't find any existing cli tool on CPAN or Debian. Since I p…

  • Commented on Third-party testing
    Fair point. An extended tester should also run the third-party tests. But I also want to run a specific smoker that only tests these and not others. So perhaps I'll do: if ($ENV{EXTENDED_TESTING} || $ENV{THIRD_PARTY_TESTING}) { ... } and: %...
  • Commented on Please Join Gittip
    Perl is at #16 now, congrats. Another tip is to not join community #1..#15 :-)...
  • Posted Third-party testing to Of course I still use Perl

    Unit testing and continuous integration testing are ways to make sure that every change to our code won't break stuffs. We execute our tests after each commit and when we want to release our software.

    On the other side of the spectrum, there are things outside our code that change and brea…

  • Posted Things we don't have #2 to Of course I still use Perl

    About this posting series. Previous episodes: #1.

    This time we're going to look at virtual filesystems. …

  • Posted So you'd like to ... do offline development and testing to Of course I still use Perl

    [This post will be imported to cpanlists.org once the service is ready]

    Do you want to develop your Perl project on your PC or laptop, without having to be constantly connected to the Internet? Then follow this simple guide.

    Creating a CPAN mirror

    First you'll want an off…

  • Commented on Stupid CPAN Tricks
    Do you even read Text::Unidecode's POD? It doesn't claim to cover all cases or even "reduce Unicode to ASCII". Its goal is to try to display Unicode characters to a non-Unicode display as best as it can. Do you prefer...
  • Commented on How I track my time with Org document and a couple of Perl scripts
    Hi David, App::JobLog looks simpler to use than App::TimeTracker, and I prefer the simple format of the ~/.joblog/log file (instead of having to deal with JSON files). Might be handy someday when I got tired doing things manually :-) Thanks!...
  • Commented on Introducing warnings::MaybeFatal
    Have you considered warnings::fatal::CompileTime or something like that? Seems more straightforward to me....
  • Commented on Downloading age-restricted videos from YouTube
    Thanks for the tip. A workaround, but as long as it works......
  • Commented on Migrating from Locale::Maketext to Locale::TextDomain
    But at various points of your program, you can do setlocale() to switch locales. The global environment (LANG, LANGUAGE) is used as a starting point only. Granted, there is a cost (varies per OS) of locale switching, but that's another...
  • Posted Installing modules from CPAN *and* your own DarkPAN to Of course I still use Perl

    I currently maintain several DarkPAN's. A DarkPAN, as some of you might already know, is a CPAN-like repository but which is not CPAN. The "dark" term refers to the fact that it is not being published on the Internet, but usually behind a corporate firewall. The most common use-case is for…

  • Posted How I track my time with Org document and a couple of Perl scripts to Of course I still use Perl

    Many of you track time when you work on the computer, either to bill your client or just to find out how long you have worked so you can track/summarize your progress. There are various ways to do this. This article will describe my own particular way which I have been using for almost 2 years. I…

  • Commented on Is Perl really short of newbies?
    B&D languages like *Python*, sorry....
  • Commented on Is Perl really short of newbies?
    I would say that Perl was *too* popular back then, due to lack of alternatives. Evidently lots of people did not like Perl (its philosophy, its choice of syntax, etc) but was forced to use it. Now that there are...
  • Commented on Is Perl really short of newbies?
    TIMTOWTDI: That's because there is always more than one way to do it, regardless of language. Perl just acknowledges the truth. I was about to post the exact same thing :) Even in B&D languages like Perl, I bet people...
  • Commented on A repl site for a lot of languages
    On repl.it: strange selection of languages. Lots of esoteric and "weird" languages but no Perl, Tcl, or several other more mainstream languages. At least, there should be Python 2 *and* Python 3. But cool site, nevertheless. IIRC, a web-based REPL...
  • Commented on Tie::File don't while(<>)
    One of the advantages of Tie::File is that you don't have to slurp all the file contents into memory. You can just push() or do a while ($item = each(@ary)), for example to work item by item. On the other...
  • Commented on Perl and Me, Part 7: The Most Powerful Weapon Which You Can Use to Change the World
    An apt analogy. I'm no CS major either, and a lot of stuffs being posted here (like Marpa and theory of parsing series) went over my head. Nevertheless, I can still write parsers :)...
Subscribe to feed Recent Actions from Steven Haryanto

  • Timm Murray commented on Do not use each

    I've also seen situations where each was called in a loop that short-circuits:

    while( my ($key, $val) = each %hash ) {
        last if $key =~ /foo/;
    }
    

    Then later on, each is used again without resetting the internal state, even though the programmer expected to iterate over the entire hash. With a hash stored globally (yes, this is bad in itself, but it happens) in a persistent environment like mod_perl, this can even happen across different requests in the same process.

  • Tim Bunce commented on Do not use each

    I wonder if there's some way to make the each op warn if the iterator isn't where it's expected to be.

  • sheila.tanner35 commented on Truth about Booking.com

    I'm currently working on my CV, portfolio, and motivation letter so I can apply to Booking.com for the UX Designer position. I'm ok with the company having a bureaucratic environment; I survived nearly 13 years in the US military. If we could have fit in any more bureaucracy there, we would have made great honorary Volgons (H2G2 reference). Not to mention, the pay can't be any worse than my current pay for the same job. I always hear about how freelance work gives you more freedom, but in my experience working as part of a team is more conducive to an atmosphere of freedom. If hired,…

  • ahmad.zawawi commented on Relief from Regexes

    By the way, "Regex Editor" dialog is a core Padre feature that I contributed back in Padre 0.57. It has nothing to do with Padre::Plugin::RegexExplain.

    So now you have used so far two of my contributions: Padre:Plugin:Moose and this regex dialog. Maybe now I should go back and work again on Farabi and Padre again :)

    Big Thanks :)

  • Diab Jerius commented on Relief from Regexes

    I'm a big fan of rxrx, which is part of Damian Conway's Regexp::Debugger package. A downside is the lack of command line history, but that can be dealt with using rlwrap.

    For those who haven't seen it in action, it steps through the regex engine displaying the results as it goes along. It is so cool! It's really illuminating, as it gives you a good sense of which parts of your expression are expensive and which are not.

Subscribe to feed Responses to Comments from Steven Haryanto

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.