Yes they work very well. Now there's the second part of the problem:

I need the read non-blocking of check if there's any
data ready before doing the 'sysread()'.

The complete consumer is a program that reads account
packets from a radius server (this problem has been solved)
and stores the Radius attributes (MAC,IP,User_name) in a 
List of Hashes. This list of hashes has to be processed 
every 60 seconds.

The consumer only reads from stdin in order to add new
packets to the listofHashes.


Here there's the consumer that works with:
#cat accounts| ./consumer.pl
where accounts has:
MAC1;IP1;USer1
MAC2;IP2;USer2


#consumer.pl
#!/usr/bin/perl -w
                                                                                                                            
my (%account,@accountList,@accountListTemp);
                                                                                                                            
while(1){
    my (@lines,$line,@values);
    sleep(60);
    @lines = <STDIN>;
    foreach $line (@lines){
        #MAC;IP;User_Name\n
        chomp($line);
        @values = split ';',$line;
        $account{"MAC"} = $values[[0]];
        $account{"IP"} = $values[1];
        $account{"Name"} = $values[2];
        push @accountList, {%account};
    }
                                                                                                                            
    my $i;
    for $i (0 .. $#accountList){
            #Process @accountList <-- IMPORTANT !!                                                                                                                            
    }
}

In reply to Re^2: Read from a Linux pipe hangs. by dmor4477
in thread Read from a Linux pipe hangs. by dmor4477

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.