The programm is working now! I developed a monitoring application for linux. I have other arrays with info about each process that I get from the proc fs...This might help to understand:
sub get_data_from_proc_fs{ opendir(PROC,"/proc"); @PROC = readdir PROC; closedir(PROC); @pid = grep /[0-9]/, @PROC; for($k=0;$k<@PID;$k++){ open(STAT,"<","/proc/$PID[$k]/stat"); ($STAT) = <STAT>; push(@app,(split(" ",$STAT))[1]); push(@pgrp,(split(" ",$STAT))[4]); close(STAT); open(CMDLINE,"<","/proc/$PID[$k]/cmdline") ; ($CMDLINE) = <CMDLINE>; push(@cmd,$CMDLINE); close(CMDLINE); } $/ = "\0"; chomp(@cmd); $/ = "\n"; } #####some code here# &get_data_from_proc_fs ; &get_system_date ; $a = 0 ; $PROC_FS_NEW = 0 ; while( $a < $PS_MONITOR ){ $b = 0 ; $found = 0 ; while( $b < $PS_PROC_FS ){ if( ($cmd_monitor[$a] eq $cmd[$b]) && ($pgrp[$b] eq $pid[$b]) +){ if( $first_time == 1 ){ $status = "NORMAL" ; $process = "${app[$b]}_${pid[$b]}" ; &print_status_info($process,$cmd[$b],$pid[$b]) ; $found++ ; } &save_info_about_running_processes_to_monitor ; $PROC_FS_NEW++ ; } $b++ ; } if(( $found == 0 ) && ( $first_time == 1 )){ $status = "ERROR" ; &print_status_info($app_m[$a],$cmd_m[$a]) ; } $a++ ; #####code continues...#

In reply to Re^4: Equal strings don't match! by pl
in thread Equal strings don't match! by pl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.