[BNE-PM] you lot have all gone quiet again? (Fwd)

Derek Thomson derek at wedgetail.com
Wed Sep 18 01:51:54 CDT 2002


Anthony Thyssen wrote:
> Derek Thomson on  wrote...
> | Anthony Thyssen wrote:
> | Horizontal columns is easy:
> | 
> | perl -le 'print for 1..100' | perl -ne 'chomp; print "$_\t"; print "\n" 
> | unless $. % 10'
> | 
> This will fail if strings are occasionaly longer than 8 characters :-)

Yes, that's right. The code to fix it would make it too long :(

> 
> You are right It actually isn't easy as a one liner.
> A very complex issue that even ls often does badly at.
> 
> | Yes, that's breaking the rules for one-liners - no modules (*everything* 
> | can be done in one line if you've got CPAN!)
> | 
> Modules (standard perl modules that is) are in my oppion permissible in
> perl one liners ;-)

There are even two kinds of "standard" module - those that come with a 
Perl distro, and those you can get from CPAN. So we'd have to define 
exactly what is allowed and what isn't. I'd say modules should be 
disallowed, as the purpose of the one liner game is to show what can be 
done with the language itself.

Clever and devious use of modules would be another type of competition, 
I think. I don't know what the rules and goals of this game would be, 
I'd have to think about it.

> 
> Never heard of Array::PrintCols!  Not a standard perl module.
> I'll have to look it up.

Neither had I, but I had faith that there would be one. A quick search 
on http://search.cpan.org, and there it was! That happens a lot with 
Perl - the solution is often just on CPAN!

--
D.





More information about the Brisbane-pm mailing list