Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Doubt in Data Structure Hash of Arrays!!!!
Hi,

I am getting some errors. I am not able to figure that out. I feel the code 
is right.I am passing an array into a subroutine and building a hash dependi
ng upon the values( grouping index with common values).

I see that some of the values are not stored in the array while printing it.
 I am pasting that section of code here.


 my($ent) = @_;
   my %assos= ();

   my @e = @$ent;

   no strict 'refs';
   my $i = -1;
   foreach my $ev (@e){
            $i++;
            if(exists($assos{$ev})){
#here the value '0' '2' '4' '11' etc are not pushed but its entering the loo
p
                    push @{$assos$ev}},"$i";  
                       print("@{$assos{$ev}}\n");
            } else{
                    $assos{$ev} = "$i";
                    print(" @{$assos{$ev}}\n");
            }
    }    

foreach my $ev ( keys %assos ) {
            print "$ev: @{ $assos{$ev} }\n";}
                      

Can anyone of you let me know what went wrong. and how to solve it.

Thank You

Asha

Report this thread to moderator Post Follow-up to this message
Old Post
asha
01-07-05 04:32 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:41 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.