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

How to grab a text from a file and assign it to a variable to compare

Expand Messages
  • p_puri99 <p_puri@hotmail.com>
    Hi there: I am very new to Perl. I am writing a very simple program to take a value from a text file (/var/log/syslog) eg. msgid= and assign it to a
    Message 1 of 3 , Dec 20, 2002
    • 0 Attachment
      Hi there:

      I am very new to Perl. I am writing a very simple program to take a
      value from a text file (/var/log/syslog) eg. msgid=<,,,,> and assign
      it to a varible to compare later in the text file.

      How could I take the vaules between <..> ?

      How could it do it ?

      Please help.

      Thanks in advance for your help.
    • Hans Ginzel
      ... man perlre; perldoc -f split; / /; $varible = $1; H.
      Message 2 of 3 , Jan 2, 2003
      • 0 Attachment
        On Fri, Dec 20, 2002 at 04:52:47PM -0000, p_puri99 <p_puri@...> wrote:
        >
        > I am very new to Perl. I am writing a very simple program to take a
        > value from a text file (/var/log/syslog) eg. msgid=<,,,,> and assign
        > it to a varible to compare later in the text file.
        > How could I take the vaules between <..> ?

        man perlre; perldoc -f split;

        /\<.*?\>/;
        $varible = $1;

        H.
      • Suresh Babu.A
        Hi All, What will be the better way to create a multiple ftp session. The number of session has to be determined by a flat file created by the user. And any
        Message 3 of 3 , Jan 2, 2003
        • 0 Attachment
          Hi All,

          What will be the better way to create a multiple ftp session. The number
          of session has to be determined by a flat file created by the user.

          And any link which talk about writing efficient perl codes.

          Thanks
          Suresh A.
        Your message has been successfully submitted and would be delivered to recipients shortly.