Loading ...
Sorry, an error occurred while loading the content.
 

help needed

Expand Messages
  • Idan Dolev
    Hi Perl gurus, I am trying to write a program that will go over my system log files and search for the words error or FAILED. I know how to find the word in
    Message 1 of 5 , Apr 18, 2002
      Hi Perl gurus,

      I am trying to write a program that will go over my system log files and
      search for the words error or FAILED.
      I know how to find the word in the file :

      chomp ($logfile = <>);
      open(LOG,"$logfile") or die "Unable to open logfile:$!\n";
      while(<LOG>){
      if (/\berror\b/i) {
      print;
      }
      }
      close(LOG);

      My problem is that I need it do go over the logs only from this day and not
      include everyday. So I need to put in the loop another condition saying that
      only line with the date that I want will be scanned for these word, how do I
      do this ?

      Thanks.

      Best regards,

      Idan Dolev
      \
    • daymobrew
      ... files and ... and not ... saying that ... how do I ... What is the format of the dates in the log file? Please post a sample line from the log file. The
      Message 2 of 5 , Apr 18, 2002
        --- In perl-beginner@y..., Idan Dolev <IDolev@i...> wrote:
        > Hi Perl gurus,
        >
        > I am trying to write a program that will go over my system log
        files and
        > search for the words error or FAILED.
        > I know how to find the word in the file :
        >
        > chomp ($logfile = <>);
        > open(LOG,"$logfile") or die "Unable to open logfile:$!\n";
        > while(<LOG>){
        > if (/\berror\b/i) {
        > print;
        > }
        > }
        > close(LOG);
        >
        > My problem is that I need it do go over the logs only from this day
        and not
        > include everyday. So I need to put in the loop another condition
        saying that
        > only line with the date that I want will be scanned for these word,
        how do I
        > do this ?
        >
        > Thanks.
        >
        > Best regards,
        >
        > Idan Dolev
        > \

        What is the format of the dates in the log file?
        Please post a sample line from the log file.
        The answer will likely be a matter of changing
        if (/\berror\b/i) {
        to
        if (/\berror\b/i) && /$Today/ {
        where $Today is a string containing an appropriately formatted date.

        Damien.
      • tvrajesh3
        Hi , I am trying to construct packet generator using perl, and iam doing Network programing in perl. I want to know about the following things: 1)WHat are the
        Message 3 of 5 , Mar 24, 2003
          Hi ,
          I am trying to construct packet generator using perl, and iam doing
          Network programing in perl.
          I want to know about the following things:
          1)WHat are the Internal memory sizes of integers , chars and
          floating point values in perl.
          2) I want to construct a packet(it holds only integers) of size 25
          bytes , few members occupies one byte integer , few 2 bytes integer,
          and few 4 bytes integer.
          3) once the packet is generated , i want to send it in the network
          byte order(In c language it is possible using htonl function). Is
          there any direct function in perl which provides the same
          functionality as htonl provides in c language.

          Rajesh
        • undiscovered_soul_38
          I m a beginner i dnt have any idea of perl. i searched different sites and tutorial bt m not getting wot exactly perl is wot r advantages of using perl over
          Message 4 of 5 , Feb 14, 2008
            I m a beginner i dnt have any idea of perl. i searched different sites
            and tutorial bt m not getting wot exactly perl is wot r advantages of
            using perl over other languages i have just installed WIndows MSI
            package can anybody plzz help me.
          • jeffrey.stebelton@citi.com
            I d suggest Learning Perl (Fourth edition) by Randal L Schwartz and others. Not only does it answer the questions you are asking, but it s a great step by
            Message 5 of 5 , Feb 14, 2008
              I'd suggest "Learning Perl (Fourth edition) by Randal L Schwartz and
              others. Not only does it answer the questions you are asking, but it's a
              great step by step way to lean Perl. You could also look at
              www.learnperl.org.

              Regards...

              Jeff




              "undiscovered_sou
              l_38"
              <undiscovered_sou To
              l_38@... perl-beginner@yahoogroups.com
              > cc
              Sent by:
              perl-beginner@yah Subject
              oogroups.com [PBML] help needed


              02/14/2008 04:58
              AM


              Please respond to
              perl-beginner@yah
              oogroups.com











              I m a beginner i dnt have any idea of perl. i searched different sites
              and tutorial bt m not getting wot exactly perl is wot r advantages of
              using perl over other languages i have just installed WIndows MSI
              package can anybody plzz help me.



              Disclaimer: The information contained in this message is confidential and intended only for the use of the individual or entity identified. If the reader of this message is not the intended recipient, any dissemination distribution or copying of the information contained in this message is strictly prohibited. If you received this message in error, please notify the sender immediately and destroy any copies you may have. Citi, Inc and its affiliates assume no liability for data tampering or loss of confidentiality, which occur outside its direct control as a result of the use of unencrypted communications methods.


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.