August 2010 Archives

Frozen Perl 2011 Meeting!

On this Thursday at 8:00 PM I will be holding the first organizational meeting for Frozen Perl 2010.

We will be meeting at Overflow Expresso Cafe in Minneapolis.

If you are interested in helping organize workshops and conferences please reply below and attend. I look forward to hearing from all of you

tail -f in perl

| 3 Comments
I have been trying to pipe a tail -f feed to a perl program to do some simple filtering on the output using regexes.

I have found that the output of 'tail -f' doesn't show up on STDIN when piped to a different command. Is there a way to do this without actually calling tail -f from within the perl application?

As I write this I found myself wondering if redirecting it to a named pipe could work. I will have to experiment with that.

Perl golf wrap up.

| 2 Comments
First off before I get too far, you can copy/paste these from the browser into an editor and it should 'unmuck' properly there. My windows XP machine did anyway. If it is a real problem, ask in the comments, filling in your email address in the comment form and I will send you this post plaintext, or you can check out the nopaste

At my office Samy Kamkar blew everybody out of the water with an awesome 64 character sort replacement:

map{$b=-1;1while$_>$y[++$b]&$b<@y;splice@y,$b,0,$_}@ARGV;print@y

I did modify each of the following to have print@A instead of print"@A" for a consistent print without spaces, and a cost savings of 2 characters.

Hobbs also gets an honerable mention at 97 characters:
@A=@ARGV;{$R|=$A=@A>1&&$A[0]>$A[1];push@G,splice@A,$A,1;@A&&redo;(@A,@G,$R)=@G,redo if$R}print@G


however Chas Owens produced the best seen here at 82 characters f:for$n(@ARGV){$s[$_]>$n&&splice(@s,$_,0,$n)>next f for 0..$#s;push@s,$n};print@s

Thank you everybody for participating. I enjoyed the submissions

Vacation

For the last two weeks I have either been on vacation, prepping for vacation, or digging out at work after vacation. As such I haven't been answering comments about my Perl Golf Part 1, Part 2, or Part 3.  Rest assured I will look at comments and answer them (thank you for all the conversation Chaz Owens).

Even Perlers need a break once in a while.

About this Archive

This page is an archive of entries from August 2010 listed from newest to oldest.

July 2010 is the previous archive.

September 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.