Juan B <mailto:[EMAIL PROTECTED]> wrote:
: Hi guys !
:
: I have four html pages. within eack one I have a firewalls
: logs.I need to write a script that will search all the ip
: address after the work "from: and wrote tham in a file and if
: the ip is written already in the report file so dont write in
: again.

    Before you start your program, write down each step you think
needs to be done. Like,

    - Get the web page,
    - Find the portion which contains the "firewalls logs",
    - Search the logs for "from:
    - etc.
    - etc.
    - etc.



    Now detail each step. Don't worry about how you are going
to use perl to do this. Just break things down to the smallest
steps you can comfortably write.

    If you have no idea how to do this, go get a cookbook. Look at
the instructions to make bread or any other complicated dish.
Think about those recipes as you write out the steps needed to
solve your problem.

    - Get the web page,
         There are four pages and their urls are:
             domain.com/log1.html
             domain.com/log2.html
             domain.com/log3.html
             domain.com/log4.html
    (BTW, log files are general text files, not HTML files.)

    - Find the portion which contains the "firewalls logs",
         For each page I need to find this tag to find the
         "firewalls logs" start:
         <!-- firewalls logs start -->

    - Search the logs for "from:
        - etc.
        - etc.
        - etc.



    Now it is time to learn some perl. You can search the perl
FAQ from your operating system command line (if you have perl
installed locally) using "perldoc" or from perldoc.perl.org.
For well commented perl script examples search Randal's site at
http://www.stonehenge.com/merlyn/LinuxMag/

    Break your problem into manageable pieces and then write a
program to solve each part of the problem while keeping in mind
that they all need to go back together for the final solution. As
you become more familiar with perl, you will be able to separate
tasks easier and write scripts faster, but, for now, take your
time and enjoy the journey.

Good luck,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to