KBD

Keith Devens .com

Saturday, March 20, 2010 Flag waving
It's such a fine line between stupid and clever. – David St. Hubbins (This is Spinal Tap)

Tag: Perl

Parents:

Daily link icon Friday, April 24, 2009

  1. Perlgeek.de Blog :: What you can write in Perl 6 today

       (0) Tags: [Perl]

Daily link icon Monday, March 23, 2009

  1. Patrick Michaud (re)wrote an RPN calculator in Perl 6. Perl 6 is so cool.

       (0) Tags: [Perl]
  2. Parrot 1.0.0 "Haru Tatsu" Released! (via). Wow, I didn't even realize they were close to 1.0. Here's hoping Perl 6 won't be too far behind. I'm really looking forward to it. I think it's going to be a very fun language to program in.

       (0) Tags: [Perl]

Daily link icon Monday, December 22, 2008

  1. use Perl | Perl 5 now uses Git for version control.

    In true open source style, Sam Vilain converted Perl's history from Perforce to Git. He did the work both in his spare time and in time donated by his employer, Catalyst IT. He spent more than a year building custom tools to transform 21 years of Perl history into the first ever unified repository of every single change to Perl. In addition to changes from Perforce, Sam patched together a comprehensive view of Perl's history incorporating publicly available snapshot releases, changes from historical mailing list archives and patch sets recovered from the hard drives of previous Perl release engineers.

       (0) Tags: [Git, Perl]

Daily link icon Monday, December 8, 2008

  1. chromatic on Python 3000:

    I'm not criticizing Python 3.0 by any means. It's a decent, modest improvement on a decent, modern language. Just don't mistake it for anything revolutionary, and don't pretend that it didn't also take almost a decade, even with Googlebucks-funded development.

    Hmm.

       (0) Tags: [Perl, Python]

Daily link icon Monday, December 1, 2008

  1. Perl 6 1.0 in March? It's taken forever but from some of the stuff I've seen, Perl 6 looks like it'll be a terribly fun (and powerful) language to code in.

    Update: Misread... Parrot 1.0 is scheduled for March, not Rakudo 1.0 (i.e. Perl 6).

       (2) Tags: [Perl]

Daily link icon Friday, November 21, 2008

Gema, the general purpose macro processor

Gema:

gema is a general purpose text processing utility based on the concept of pattern matching. In general, it reads an input file and copies it to an output file, while performing certain transformations to the data as specified by a set of patterns defined by the user. It can be used to do the sorts of things that are done by Unix utilities such as cpp, grep, sed, awk, or strings. It can be used as a macro processor, but it is much more general than cpp or m4 because it does not impose any particular syntax for what a macro call looks like. Unlike utilities like sed or awk, gema can deal with patterns that span multiple lines and with nested constructs. It is also distinguished by being able to use multiple sets of rules to be used in different contexts.

Another neat feature is that it has bindings to Lua that let you run arbitrary Lua code to operate on the result of a match.

I came across Gema years ago, but while I've never had the opportunity to use it for anything, I kept it in the back of my mind as an interesting project. I've been wondering how similar what it does is to Perl 6 grammars, so I've been meaning to check out Gema again, although I couldn't remember the name until just now.

Daily link icon Wednesday, September 3, 2008

  1. Moritz Lenz's blogs on Perl 6, intended for people familiar with Perl 5, have done a lot to get me re-interested in Perl 6, despite how long it's taken to develop.

    My understanding is that a full release of Perl 6 is probably another year away, but it may have been worth the wait. Perl 6 looks like a really fun language.

       (0) Tags: [Perl]

Daily link icon Wednesday, September 12, 2007

while(<>){...} in Ruby

Re: translate Perl diamond operator to Ruby.

Perl:

while(<>){
  ...
}

Ruby:

ARGF.each do |$_|
  ...
end

At this point I question whether I'd ever use Perl for anything again. Until now, Perl filled a niche where if the code I wanted to write would fit in 10 lines or so, and did a lot of string manipulation, I'd turn to Perl. Otherwise Python. Now I think I'll just use Ruby for everything Smiley

Daily link icon Thursday, July 27, 2006

Dumb substring behavior in C# (and Java)

Substring in C# (and Java) throw an exception if you take a substring and give it a length (or a starting position) that puts you after the end of the string. That's basically to ensure that you always get a string that's exactly the length you want? Rather than just being able to take a substring and not having to worry about it, you have to include code like the following around every single substring you ever take:

if (str.Length > 30){
    str = str.Substring(0, 30);
}

Typically when you take a substring you want to ensure that your string is no longer than a certain number of characters. I can't think of a situation that would it a good idea for the language to enforce that you can't get a string that's less than the maximum length you want instead of exactly the length you want.

On the other hand, most of the dynamic languages (PPPR) let you substring off the end of the string without worrying about it.

Daily link icon Wednesday, May 17, 2006

  1. perl.com: Perl Command-Line Options. Good reference and tutorial.

       (3) Tags: [Perl]

Daily link icon Friday, March 24, 2006

  1. Here's some quick Perl I used to unescape some form-encoded data:

    while(<>){
        s/\+/ /g;
        s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge;
        print;
    }
       (0) Tags: [Code, Perl]

Daily link icon Sunday, February 5, 2006

  1. reform - Third millenium syntax for Perl 5 OOP (via Keith). Actually reasonable OO syntax in Perl.

       (0) Tags: [Perl, Programming]

Daily link icon Thursday, November 17, 2005

  1. First monads in Perl, now monads in Ruby (via Keith Gaughan, via The Farm), both still to read.

       (0) Tags: [Monads, Perl, Programming, Ruby]
March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.148s.

(Used 10 db queries)