Help for this page

Select Code to Download


  1. or download this
    my $rv = sysread(FIFO, $fifodata, 64*1024, length($fifodata));
    
  2. or download this
    my $rv = sysread(FIFO, $fifodata, 64*1024, length($fifodata));
    
    ...
        ...extract message from $fifodata...
        ...process message...
    }
    
  3. or download this
    while (length($fifodata) > $MSG_SIZE) {
        my $msg = substr($fifodata, 0, $MSG_SIZE, '');
        process_msg($msg);
    }
    
  4. or download this
    while ($fifodata =~ s/^([^\n]*\n)//) {
        my $msg = $1;
        process_msg($msg);
    }