Find the answer to your Linux question:
Results 1 to 9 of 9
Greetings everyone It has come to my attention that perl is a the language of Sys Admin. But yet some people would say that perl is ugly language not easy ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2003
    Posts
    16

    New To Perl


    Greetings everyone


    It has come to my attention that perl is a the language of Sys Admin. But yet some people would say that perl is ugly language not easy to learn for newbies to programming. How true is this and how does one go about resolving this issue.

    Some people have gone so far as saying that python can do just as much as perl and is much cleaner which is true but how common is it as a sys admin language of today?

    I would like to learn perl so that i too can benefit from it within my field. If python can do just as much seeing how it is object orienated language and alot easier do you think it is possible to use python over perl?

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Thats not true!! Perl is a much more scaleble program-language and if you learn it you can program almost anything. It have databasesupport and there are a bunch modules you can use.

    Perl is much alike ordinary shell/bash scripting when it comes to the syntax. So maybe you can start with that if you think that is simplier. Otherwise Perl is very good documented so its easy to get good documentation. You can also type

    Code:
    info perl
    as root in a terminal for more information on Perl. The docs that are included in linux is also good.

    Regards
    Regards

    Andutt

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    The very fact that python is object oriented makes me despise it. Also, the very fact that perl isn't very clean is precisely what makes it so useful. There isn't really anything wrong with the language itself, it's just that the syntax is "write only", if you see what I mean. That is precisely the strength of the language, though. It is incredibly easy to write a small script that does powerful things in a very small amount of time, and that is precisely what perl is intended for. Of course, like andutt says, it is scalable, so you can do large projects as well, but small scripts for automation of tasks or generation of status reports is what perl was designed to do, and it is also what it's best at.

  4. #4
    Just Joined!
    Join Date
    Jun 2003
    Posts
    16
    I understand what you are saying as to perl being write only. Now the only thing that is left is what would be a good book for it. O'reilly - Learning Perl. What do you think any suggestions guys?

    You mentioned one can do alot with perl do you think if someone wrote a perl script in linux and needed to use the same script on a windows machine or machines would it work with needing any modifications?

  5. #5
    Just Joined!
    Join Date
    Jun 2003
    Posts
    16
    I was aslo wondering what all can PERL interact with as for databases? MYSQL? ACCESS? I am curious

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Considering how much UNIX differs from Windows, I wouldn't bet that there would be no modifications required. It all depends on what the script does, though.

    I would be surprised if Perl had no MySQL interaction module. I know for a fact that it does DBM databases, though. Those are not SQL-based on the other hand. Why ever would you want to interface against a MS Jet database? They suck so much that words cannot express it.

  7. #7
    Linux Newbie
    Join Date
    Aug 2001
    Location
    USA, Texas
    Posts
    217
    There are definately database access modules for Perl. To connect to a database irst you need DBI and then you need the "driver" or the DBD file for the specific database. A few are DBD::mysql for MySQL, DBD:g for PostgreSQL, and DBD::Informix for Informix databases. And on the Windows side there is a DBD::ODBC that I have only actually used once.
    [ [ SykkN alloc ] initWithThePowerTo: destroyYouAll ];
    /* Don\'t make me use it! */

  8. #8
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    It also has modules for oracle, sysbase, MSSQL, Msql, and db2. There is about 30 other modules for rdbm's. You can view the list on cpan.

  9. #9
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Yes you can later run you perlscripts on windows if you want, but if you want that you have to install Active Perl for windows which acts as the interpreter.

    I have written some both for Oracle and Sqlserver (on MS) which worked OK...but if you are planning to interact with os-commands linux is deffenetly better!! Windows dos-commands are pretty weak theese days.

    Regards
    Regards

    Andutt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •