Re: Future of debian-cd
* Jan Kesten
| Here is the perl way of opening a file, reading it and sorting the
| lines into a new file:
#! /usr/bin/perl -w
use strict;
my $file = shift;
open IN, "<$file" or die "Can't open $file: $!";
open OUT, ">$file.sorted" or die "Can't open $file.sorted: $!";
print OUT sort <IN>;
This is fairly readable to me at least; yes, it's possible to write it
shorter, and it's possible to write it without strict, but it's a nice
safety net.
| And the python way looks like this:
[...]
| Some other thing is that python knows about classes :-) But I do not
| want to start a discussion about pro perl or python :-)
I don't think the python code here looks better at all. It's possible
to write both readable and unreadable python or perl.
--
Tollef Fog Heen ,''`.
UNIX is user friendly, it's just picky about who its friends are : :' :
`. `'
`-
Reply to: