[Cologne-pm] Warum Perl?

Michael Lamertz mike at lamertz.net
Tue Apr 1 09:47:30 CST 2003


On Tue, Apr 01, 2003 at 12:23:35AM +0200, Stefan Denker wrote:
> On Mon, Mar 31, 2003 at 10:37:33PM +0200, cem.sakaryali at easi.de wrote:
> 
> Es wäre hilfreich zu erfahren, was dieses Programm in groben Zügen tut.
> Die Wahl des Werkzeugs hängt nämlich immer von dem zu bearbeiteten
> Werkstück ab.

Leatherman?  ;)

> Womit ich sagen will: Die Programmiersprache stimmt man
> auf das Problem ab. Wenn ich Schnelligkeit brauche,

Schnelle Laufzeit, oder schnelle Ergebnisse?  Wie schnell ist "Schnell
genug"?

> nehme ich kein Java,
> sondern C. Wenn ich viel mit Strings umherhantieren muß, nehme ich kein
> C, sondern Perl...
> 
> > - mehr moeglichkeiten als awk
> 
> Naja, vielleicht nicht mehr, aber einfacher komplizierteres zu
> programmieren.

    /me fetches the Rocketlauncher...

Doch, *viel* mehr  (ACHTUNG: MEGASPAM :) :

    ---------- perldoc perlfunc ----------
       Perl Functions by Category

       Here are Perl's functions (including things that look like functions,
       like some keywords and named operators) arranged by category.  Some
       functions appear in more than one place.

       Functions for SCALARs or strings
           "chomp", "chop", "chr", "crypt", "hex", "index", "lc",
           "lcfirst", "length", "oct", "ord", "pack", "q/STRING/",
           "qq/STRING/", "reverse", "rindex", "sprintf", "substr",
           "tr///", "uc", "ucfirst", "y///"

       Regular expressions and pattern matching
           "m//", "pos", "quotemeta", "s///", "split", "study", "qr//"

       Numeric functions
           "abs", "atan2", "cos", "exp", "hex", "int", "log", "oct",
           "rand", "sin", "sqrt", "srand"

       Functions for real @ARRAYs
           "pop", "push", "shift", "splice", "unshift"

       Functions for list data
           "grep", "join", "map", "qw/STRING/", "reverse", "sort",
           "unpack"

       Functions for real %HASHes
           "delete", "each", "exists", "keys", "values"

       Input and output functions
           "binmode", "close", "closedir", "dbmclose", "dbmopen", "die",
           "eof", "fileno", "flock", "format", "getc", "print",
           "printf", "read", "readdir", "rewinddir", "seek", "seekdir",
           "select", "syscall", "sysread", "sysseek", "syswrite",
           "tell", "telldir", "truncate", "warn", "write"

       Functions for fixed length data or records
           "pack", "read", "syscall", "sysread", "syswrite", "unpack",
           "vec"

       Functions for filehandles, files, or directories
           "-X", "chdir", "chmod", "chown", "chroot", "fcntl", "glob",
           "ioctl", "link", "lstat", "mkdir", "open", "opendir",
           "readlink", "rename", "rmdir", "stat", "symlink", "sysopen",
           "umask", "unlink", "utime"

       Keywords related to the control flow of your perl program
           "caller", "continue", "die", "do", "dump", "eval", "exit",
           "goto", "last", "next", "redo", "return", "sub", "wantarray"

       Keywords related to scoping
           "caller", "import", "local", "my", "our", "package", "use"

       Miscellaneous functions
           "defined", "dump", "eval", "formline", "local", "my", "our",
           "reset", "scalar", "undef", "wantarray"

       Functions for processes and process groups
           "alarm", "exec", "fork", "getpgrp", "getppid", "getpriority",
           "kill", "pipe", "qx/STRING/", "setpgrp", "setpriority",
           "sleep", "system", "times", "wait", "waitpid"

       Keywords related to perl modules
           "do", "import", "no", "package", "require", "use"

       Keywords related to classes and object-orientedness
           "bless", "dbmclose", "dbmopen", "package", "ref", "tie",
           "tied", "untie", "use"

       Low-level socket functions
           "accept", "bind", "connect", "getpeername", "getsockname",
           "get- sockopt", "listen", "recv", "send", "setsockopt",
           "shutdown", "socket", "socketpair"

       System V interprocess communication functions
           "msgctl", "msgget", "msgrcv", "msgsnd", "semctl", "semget",
           "semop", "shmctl", "shmget", "shmread", "shmwrite"

       Fetching user and group info
           "endgrent", "endhostent", "endnetent", "endpwent",
           "getgrent", "getgrgid", "getgrnam", "getlogin", "getpwent",
           "getpwnam", "getp- wuid", "setgrent", "setpwent"

       Fetching network info
           "endprotoent", "endservent", "gethostbyaddr",
           "gethostbyname", "gethostent", "getnetbyaddr",
           "getnetbyname", "getnetent", "getpro- tobyname",
           "getprotobynumber", "getprotoent", "getservbyname",
           "getservbyport", "getservent", "sethostent", "setnetent",
           "setpro- toent", "setservent"

       Time-related functions
           "gmtime", "localtime", "time", "times"
    ---------- perldoc perlfunc ----------

Abgesehen davon:

    * awk's Datenstrukturen flach, weil's dort keine Referenzen gibt.

        awk(1): "Awk provides  one-dimensional  arrays."

    * awk hat keinen eigenstaendigen Programmfluss, sondern ist *immer*
      eventgesteuert.

    * Und selbst das Stringhandling in awk ist eigentlich das was man als
      Minimum braucht.

-- 
	    Well, then let's give that Java-Wussie a beating... (me)

Michael Lamertz                        |     +49 2234 204947 / +49 171 6900 310
Sandstr. 122                           |                       mike at lamertz.net
50226 Frechen                          |                 http://www.lamertz.net
Germany                                |               http://www.perl-ronin.de 



More information about the Cologne-pm mailing list