Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
here's the the code, the regex for Deferred is working now, but still I am running out of idea how store multiple recipients associating with the qid, any idea?
#!/usr/bin/perl use Data::Dumper; open (Q,"-|" , "cat mailqout" ); my $ref_tomailq= []; my $coutner = 0; my $temp_qid; while(<Q>) { # Ignore the banners and totals next if m{ Q-ID }ix ; # Ignore any completed jobs #next if m{ ^ .{10,20} \s \(job \s completed\) }x; if( m{ ^\w+ }ix ) { my @ar_line = split(/\s+/,$_); my $num_char = length($ar_line[0]); if ( $num_char > "0") { #print "$ar_line[$counter] $ar_line[-1]"; $ref_tomailq->[$counter]->{$ar_line[0]}->{"fro +m"} = $ar_line[-1]; $temp_qid = $ar_line[0]; $counter++; } } else { my @ar_line = split(/\s+/, $_); chomp(@ar_line); if ( $ar_line[1] =~ /\(Deferred:/) { $ref_tomailq->[$counter-1]->{$temp_qid}->{"sta +tus"} = "deffered"; } elsif ($ar_line[1] =~ /<{1}\w+>?/) { #print "@ar_line\n"; $ref_tomailq->[$counter-1]->{$temp_qid}->{"to" +} = $ar_line[1] } } } print Dumper($ref_tomailq);
Thanks.

In reply to Re^2: hashing out lines from mailq... by perlknight
in thread hashing out lines from mailq... by perlknight

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-29 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found