Solved

Continued - 500++ POINTS - Tricky Tracking....Mod

Posted on 2006-11-16
3
209 Views
Last Modified: 2010-03-05
I am ready to BLOW!!!!!

Below routine that worked great, as soon as I added the date field to the data base, I lost my results!

HERE IS THE NEW DATA ROW:
tgvz4263002|A@aol.com||Yes|Yes|Yes|Beth Banana|94455|886-555-6547|B@aol.com|Thu Nov 15 11:06:12 2006

HERE IS THE WORKING ROUTINE FROM OZO:

while( <FILE> ){
    chomp;
    my ($R,$i,$n,$p)=(split/\|/)[1,-1,6,8];
    $R{$i}{$R}="$n : $p : $i <br />\n";
}
my @i = ($TRACK_BACK_EMAIL);
my %seen=();
while( my $R = shift(@i) ){
    for( keys %{$R{$R}} ){
        unshift @told, $R{$R}{$_};
        push @i,$_ unless $seen{$_}++;
    }
}
my $count=0;
my $results='';
for( @told ){
    $results .= ++$count.") $_";
}
0
Comment
Question by:precision
3 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 17960369
-1 picks the last field, which is now the date
Either change it to -2, if it will always be the second to last field,
or to 9, if it will always be the nineth field
    my ($R,$i,$n,$p)=(split/\|/)[1,9,6,8];

0
 
LVL 17

Expert Comment

by:mjcoyne
ID: 17960427
Where are the hash %R, the array @told, and the scalar $TRACK_BACK_EMAIL initialized and scoped?  If you're running under the strict pragma, these are errors...

Since you re-declare the scalar $R each time through the "while" loop, and there is no $R hash declared, could the %R hash be re-initalized as well (assuming you're not running under strict, which you should always do, if you are it would Perl would throw an exception)?  Must you use the same names for these data structures?
0
 

Author Comment

by:precision
ID: 17960765
Ozo, you always seem to amaze me each time, BINGO!  Do you have any training courses?  Where are you located?

Thanks so much....Your a genius
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl program to obtain a machine's memory usage 6 22
Perl for loop for 2000 ms 7 100
rename outfile before writing 2 72
parse a file and get data out 11 45
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question