My experience is that architecturally Perl cannot handle this. You should 
switch to Java and use an Enterprise Java Bean to do all this for you.

My hint to you is use a hash where the key is a SSN# to help you. Of 
course, your description of what you want to accomplish is quite ambiguous 
so who knows whether this will really help you.  But I notice you are 
attempting to do a lot of stuff with arrays when I think hash would help.

Anyway, this isn't the place to post non mod_perl questions anyway. Please 
find a normal Perl syntax mailing list please and do not clutter up this 
list with Perl newbie questions -- this is a mod_perl list not a Perl 
syntax list. Perl.com has links to a lot of these resources.

At 05:19 PM 6/12/01 -0400, F.H wrote:

>Hi All,
>I have a text file like this:
>
>Name ,123-43-4352, JX, 1234
>Sports,123-43-4352, SKI, BaseBall, swimming
>Hobbies, 123-43-4352, H1,H2, H3
>Hobbies, 123-43-4352, HH, HHH, HHHH2
>Hobbies,123-43-4352, H1,H43
>
>Name ,223-63-9352, JX, 1234
>Sports,223-63-9352, SKI, BaseBall, swimming
>Hobbies, 223-63-9352, H1,H2, H3
>Hobbies, 223-63-9352, HH, HHH, HHHH2
>Here is my issue, I am trying to access each record in this file by SSN
>ie: (223-63-9352)
>I want to be able to say:
>for SSN = 223-63-9352,  for Hobbies4 4th entry is HGFR.
>
>while ($line = <INPUT>){
>
>
>     @line = &parse_line(',',0,$line);
>       if ($line[0] =~ /^NAME/gi){
>         $ssn = $line[1] ;
>           push(@ssns, $ssn);
>
>               }
>
>         if ($line[0] =~ /^Sports/gi ){
>
>           push(@sports, $line)
>
>         }
>
>         if ($line[0] =~ /^Hobbies/gi){
>
>          push(@hobbies, $line)
>
>        }
>
>for ($i = 0; $i<= $#ssns; $i ++)
>  {
>    print "For  $ssns[$i]\n";
>
>         for ($i = 0; $i <= $#Hobbies ; $i++){
>
>                    if ($Hobbies[$i] =~ $ssns[$i])
>                    { print "Hobbies are: $Hobbies[$i]\n";}
>}
>
>
>I wanted to print out for each SSN corresponding SSN numbers but it's just
>not working!!! If this is feasible in Perl I'd appreciate if someone could 
>help.
>
>
>Thanks
>I.S
>
>__________________________________________________________________
>Get your own FREE, personal Netscape Webmail account today at 
>http://webmail.netscape.com/

__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/

Reply via email to