Josselin Mouette <[EMAIL PROTECTED]> writes: > Le samedi 28 janvier 2006 à 21:19 -0600, Manoj Srivastava a écrit : > >> And if we followed the the line of argument you are pressing >> uncritically, we'd bloat essential/base with gazillions of >> interpreters from people too lazy or incompetent to learn the >> interpreters already in base. > > I prefer to be labeled as incompetent by people like you than to write > scripts that no one will be able to understand later. Every time I face > a write-once, never change perl script, the only thing to do is to > rewrite it. And this isn't a Debian-specific issue.
Don't blame the language[1], but the people. You can as well code unbearable code in C/C++/Mono/C# (whatever) that no-one can understand. The Perl syntax is elegant, efficient and Python's regexp handling is nowhere as intuitive as needed for day-to-day tasks where the poer is needed. This is not to day that Python is bad - It has better OO, which Perl unfortunately negletted fromt he very starts. Now, talk about Perl OO and that's hairy!. Jari [1] Example of Perl coding (do not blame the language): # **************************************************************************** # # DESCRIPTION # # Convert tokens 7m, 2h, 3d into minutes. Die if value is not numeric. # # INPUT PARAMETERS # # none # # RETURN VALUES # # none # # **************************************************************************** sub TimeValue ($) { my $id = "$LIB.TimeValue"; local ($ARG) = (@ARG); if ( /^(\d+)([mhd]?)$/ ) { $ARG = $1; my $spec = $2 if defined $2; $debug and print "$id: val [$ARG] spec [$spec]\n"; my $factor = 1; $factor = 60 if $spec =~ /h/i; $factor = 60 *24 if $spec =~ /d/i; $ARG *= $factor; $debug and print "$id: val [$ARG] factor [$factor]\n"; } else { die "$id: Not a recognized time value [$ARG]. Try 2m, 2d, 2h"; } $ARG; } -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]