Mailinglist Archive: opensuse-factory (757 mails)

< Previous Next >
Re: [opensuse-factory] Learning Perl (Was: Re: [opensuse-factory] tagmedia question)
On Fri, May 05, 2006 at 04:12:10PM +0200, Peter Jakobi wrote:
> The Good:

Not for me.

> - saying 1 means there are many idiomatic conventions to use
> Perl. Say just rewrite a C program 1:1 in perl, upto C's
> for and while statements, and your convention for translation
> a case cascade.

I don't rewrite C, becaue I can't do C.

> Say just rewrite a shell script using awk.

I can't do awk either.

> In both cases, perl's syntax allows you to retain most
> of the syntactic and semantic structure of say C or AWK.
> Perl even supports awk's BEGIN blocks, so you've to peek
> that the #! line on top to be sure you're reading perl...

That is nice. Well, if you know what people are talking about. I don't
know what a BEGIN block is.

> Or lisp. Perl has lists, and map (plus shortcuts like
> pop,unshift, grep, ...). cdr is missing, but you just use
> shift.

Chnese to me. I don't do Lisp.

> Lambda objects are function refs, etc. Everything's
> there, except the visual appeal of being able to have a
> syntactically necessary lines finishing with a block of
> 20+ closing parantheses.

Sounds interesting. Although I have no idea what it means.

> Saner persons than RMS however
> cite this as the sole reason to avoid lisp :).

I heard him speak unfortunatly at FOSDEM. Everybody is saner then RMS.
After listening to him I had an urge to walk into a store, buy XP Pro and
install it.

> perl baby talk's fine.
> Or a decide later an idiomatic open or die stanza followed
> by a schwartzian transform-resort of file data. What on
> the commandline would be something like map|sort|map.
> Functional programming and lisp also comes to mind.

Uhm. OK. (Or as they say in Germany "Ich verstehe nur Bahnhof."

> - obfuscation is easy. also unintentional obfuscation.
> So self-discipline is a bit more important than in more
> restrictive - or crippled - environments elsewhere.

For me reading somebody elses bash code looks already as if it was
obfuscationized code.

> - perl5 has support to create your own OO-"Language" on top of it.
> However it is decidedly no object-oriented language.
> [ok, this is opionated, but unless one has a SINGLE RIGHT one way
> to use e.g. inheritance and overload my parent's functions
> within a well-defined oo interface, the language just isn't
> oo. Just like C. Not if every one develops his/her own OO inheritance
> conventions. Heck, you can never be sure of object itself: does the modul
> I'd like to reuse use a scalar or a blessed hash as base for his objects??
> Saying1 vs. Perl5 = 1 : 0, Perl5 standing, but with hole shot in foot.]
> Python wins here, as well as that rumoured new language to be
> called perl 6. being able to _BREAK_ any perl5 syntactic rules.

Well, I don't do Python either.

> >Then I started to put in a "for" for the booting and copying and started to
> >make it more generic. A bit later added some features.
> Which is just fine when using perl for small, single-authored scripts...

Sure it is, if you know what you are doing and know perl. I am sure my
code would be better written in perl. If I would understand perl, I would
have just taken create_package_descr and edited it. It would have been a
lot easier, because makeSUSEdvd is nothing more then a wrap around it.

It would be also a lot easier to include tagmedia in it, instead of
leaving it as a seerate program.

However, I am not a programmer, nor will I ever be one. If at most I am a
mediocre scriptwriter. Again, perl will be a great langage, it is just not
for me.

Nutze die Zeit. Sie ist das Kostbarste, was wir haben, denn es
ist unwiederbringliche Lebenszeit. Leben ist aber mehr als Werk
und Arbeit, und das Sein wichtiger als das Tun - Johannes Müller-Elmau

< Previous Next >
Follow Ups